Sunday, November 7, 2021

How to get label, name and data type of all fields of any table

 static void JobTableLabel(Args _args)

{


    DictTable       dt=new SysDictTable(tableNum(HcmWorker));

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

    }

}