Monday, December 6, 2021

Get label for table using x++ in D365FO

 Hi, guys today we see how to get a table, fields label value using x++.


Info(strfmt('Table name : %1, Lable : %2 ', tablestr(VendTable), tablePName(VendTable)));



tablestr --> It will retun table name. O/P -> VendTable.

tablePName--> It will retun lable name of table. O/P -> Vendors.


Field label:

info(fieldPName(VendTable, AccountNum));


Label, Name, and Data type of all fields of any table:

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); }


Keep Daxing!!

No comments:

Post a Comment