DictIndex.numberOfFields Method [AX 2012]

Returns the number of fields in the index definition.

public int numberOfFields()

Run On

Called

Return Value

Type: int
The number of fields in the index.

The following example shows the retrieval of the number of fields in the index and lists the names of the fields in the index.

Dictionary dict; 
DictTable  table; 
DictIndex  idx; 
DictField  field; 
int i; 
 
dict = new Dictionary(); 
table = new DictTable(dict.tableName2Id("Address")); 
idx = new DictIndex(table.id(), table.indexName2Id("AddrIdx")); 
for (i=1; i <= idx.numberOfFields(); i++) 
{ 
    field = new DictField(table.id(), idx.field(i)); 
    print field.name(); 
}

Community Additions

ADD
Show: