projTable_ds.object(fieldnum(ProjTable, Dimension[5])).enabled(false);
There are two things that spit in my face above. The first is that it doesn't compile. The second is that the fifth dimension is indicated explicitly as a number, the code below will explain better: int dimProject;
;
dimProject = Dimensions::code2ArrayIdx(SysDimension::Proyecto);
So now we can get the index of our 'Project' dimension. The code is more maintainable than just using the integer index directly.Finally the end result:
FieldId dimFieldId, extFieldId;
DictField dictField;
int dimProject;
;
dimProject = Dimensions::code2ArrayIdx(SysDimension::Proyecto);
dimFieldId = fieldnum(ProjTable, Dimension);
extFieldId = fieldId2Ext(dimFieldId, dimProject);
projTable_ds.object(extFieldId).enabled(false);
So the Global::fieldId2Ext() method is what was missing which returns an extended FieldId - a fieldId that includes the the array index.Heads up to Palle Agermark on this one.
No hay comentarios:
Publicar un comentario