Thursday, September 1, 2011

SysDictTable and DictField

It is appeared that often we need to prepare a list for field names, their label and types for documentation or exchange of information. This small code snippet helps to achieve the same to great extend.

static void SystemClassesFields(Args _args)
{
SysDictTable dictTable;
DictField dictField;
Common common;
Counter counter;

;

dictTable = new SysDictTable(tableNum(CustTable)); //Can have different table name here

for (counter=1; counter<=dictTable.fieldCnt(); counter++)
{
dictField = new DictField(dictTable.id(), dictTable.fieldCnt2Id(counter));

if (!dictField.isSystem())
{

info(strfmt("%1 - %2 - %3", dictField.label(),dictField.name(),dictField.baseType()));
}
}
}

No comments:

Post a Comment