Get all fields name, type, mandatory and label of any AOT table or view

 Write below job to get list of fields, mendatory, base data type and label for any particular table or view:

static void Main(Args _args)
{
    DictTable           dictTable = new SysDictTable(tableNum(VendTable));
    FieldId             fieldId = dictTable.fieldNext(0);     
    DictField           dictField;
    while(FieldId)
    {
        dictField = dictTable.fieldObject(fieldId);
        info(strFmt("%1-%2-%3-%4", dictField.name(), dictField.mandatory(), dictField.baseType(), dictField.label()));
        fieldId = dictTable.fieldNext(fieldId);
    }
}

Comments