DictFieldGroup.numberOfFields Method [AX 2012]

Returns the number of table fields and edit and display methods in the field group.

public int numberOfFields()

Run On

Called

Return Value

Type: int
The number of table fields and edit and display methods in the field group.

The following example shows the retrieval of the number of table fields and edit and display methods in a field group.

    DictFieldGroup  fldGrp; 
    DictField       fld; 
    fieldId         fldId; 
    tableId         tblId; 
 
    int             i; 
 
    tblId = tablenum("CustTable"); 
 
    fldGrp = new DictFieldGroup(tblId,"AutoReport"); 
 
    if (fldGrp) 
    {     for (i=1; i <= fldGrp.numberOfFields(); i++) 
         { 
             fldId = fldGrp.field(i); 
             fld  = new DictField(tblId, fldId); 
             if (fld) 
             { 
                print 'Field: ' + fld.name() 
       + ' (' + int2str(fldId) + ')'; 
             } 
             else 
             { 
                print 'MethodName: ' + fldGrp.methodName(fldId)  
                + ' (' + int2str(fldId) + ')'; 
             } 
         } 
    }

Community Additions

ADD
Show: