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 :

How to get table and view field properties via code.

GirishS Profile Picture GirishS 27,827 Moderator

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.

Comments

*This post is locked for comments