web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Reflection code to iterate on the primary index of the table

Fawad Hassan Profile Picture Fawad Hassan 337

Below is the job that contains code to retrieve the fields in a primary index of a table

static void IndexFieldsReflectionJob(Args _args)

{

DictIndex dictIndex;

DictTable dictTable = new DictTable(tableNum(testTable);

IndexId indexId;

int indexCounter;

fieldid fieldId;

DictField dictField;

indexId = dictTable.primaryIndex();

dictIndex = new dictIndex(dictTable.id(), indexId);

if  (dictIndex)

{

for (indexCounter = 1; indexCounter < dictIndex.numberOfFields(); indexCounter++)

{

fieldId = dictIndex.field(indexCounter);

dictField = new DictField(dictTable.id(), fieldId);

print DictField.name();

}

}

pause;

}



This was originally posted here.

Comments

*This post is locked for comments