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

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...