Showing posts with label Check Mandatory fields in table level in Ax 2012. Show all posts
Showing posts with label Check Mandatory fields in table level in Ax 2012. Show all posts

Wednesday, 30 May 2018

Check Mandatory fields in table level in Ax 2012

static void checkMandatoryFields(Args _args)
{
    DictTable       dictTable;
    DictField       dictField;
    int             i, cnt;

    dictTable = new DictTable(tableNum(HcmWorker));
    cnt = dictTable.fieldCnt();
    for (i= 1; i<=cnt;i++)
    {
        dictField = new DictField(tableNum(HcmWorker),dictTable.fieldCnt2Id(i));
        if (dictField.mandatory())
        {
            info (strFmt("Field %1 is mandatory.",dictField.label()));
        }
    }

}