AX – D365FO – Get Field, Label, Type and Name using X++

Following are they way to get Table Label
static void Job21(Args _args)
{
    info(TablePName(CustTable));
}

image

Following are they way to get Field Label of the table
static void Job21(Args _args)
{

    info(fieldPName(CustTable,AccountNum));
}

image

Following is the way to find Label , Name and Data type of all fields of any table.
static void Job21(Args _args)
{

    DictTable       dt=new SysDictTable(tableNum(CustTable));
    FieldId       _fieldId=  dt.fieldNext(0);
    DictField     _dictField;

while(_fieldId)
    {
      _dictField  =dt.fieldObject(_fieldId);
 info(strFmt(“Field Name %1 , Field Lable %2 and Field Type %3”, _dictField.name(),_dictField.label(),_dictField.type()));     _fieldId=  dt.fieldNext(_fieldId);
    }
}

image

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s