List of mandatory fields on a table
When you want a list of all the mandatory field on table X, yould check all the properties on the table fields, or you could be lazy and write a small job that does the trick for you. Just replace TableId with your tablenum.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | static void CheckMandatoryFieldsOnTable(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()); } } } |
Tags: AOT, Ax 4.0, Ax 5.0 (2009), DictTable, Dynamics AX, Programming, Tips & Tricks, X++
This entry was posted on Monday, February 22nd, 2010 at 08:00 and is filed under Dynamics AX. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

