How to get table and view field properties via code.
Views (82)
Hi All,
In this blog I will explain you how to get the table and view field properties via code.
We can make use of the SysDictTable to get the Propeties of the fields.
Refer to the below code.
//pass the table name where you want to get the field name propety.
SysDictTable dictTable = new SysDictTable(tableNum(DefaultDimensionView));
SysDictField dictField;
TreeNode treeNode;
//Get the fieldId list.
FieldId fieldId = dictTable.fieldNext(0);
DictView dictView;
//Loop through the field id.
while (fieldId)
{
dictField = dictTable.fieldObject(fieldId);
if (dictField.isSql() && !dictField.isSystem())
{
treeNode = dictField.treeNode();
info(strFmt("%1 | %2 | %3",
dictField.name(),
treeNode.AOTgetProperty("Data Field"),
treeNode.AOTgetProperty("Label")));
//similary you can get the other properties using AOTgetProperty method.
}
fieldId = dictTable.fieldNext(fieldId);
}
Hope this is helpful.
Thanks.

Like
Report
*This post is locked for comments