Monday, August 28, 2017

Get Table Field Name and Field Properties AX 2012

//Get Table Field Name and Field Properties AX 2012

SysDictTable    dictTable = new SysDictTable(tableNum(yourTable));
    SysDictField    dictField;
    TreeNode        treeNode;
    TmpTable     tempTableChk;
    FieldId         fieldId = dictTable.fieldNext(0);
    while (fieldId)
    {
        dictField = dictTable.fieldObject(fieldId);
        if (dictField.isSql() && !dictField.isSystem() && dictField.name() != "Modified")
        {
            treeNode = dictField.treeNode();
            tempTableChk.Field = dictField.name();
            tempTableChk.Label = treeNode.AOTgetProperty("Label");
            tempTableChk.insert();
        }
        fieldId = dictTable.fieldNext(fieldId);
    }

No comments:

Post a Comment

Search hierarchy for a match (TableALLGroup) X++

  Table1 ppt;  select firstonly ppt  order ItemCode, ItemRelation, AccountCode, AccountRelation where      (ppt.ItemCode == TableGroupAll::T...