Tuesday, April 16, 2013

Find mandatory fields in a table

static void Raj_MandatoryFieldsOnTable(Args _args)
{
    DictTable dictTable;
    DictField dictField;
    int i;
    TableId tableId = tablenum(CustTable);
    ;
   
    dictTable = new DictTable(tableId);

    for (i=1 ; i<=dictTable.fieldCnt() ; i++)
    {
        dictField = new DictField(tableId, dictTable.fieldCnt2Id(i));
        if (dictField.mandatory())
        {
            info(dictField.name());
        }
    }
}

No comments: