DictField.flags Method [AX 2012]
Returns an integer that defines the properties of the field. The flag values, such as DBF_MANDATORY, are defined in the DictField macro.
Use the Global::bitTest Method method or the & operator to check individual flag values.
The following example shows the retrieval of the flags of a field to determine whether the field is mandatory.
#macrolib.dictfield
DictField df;
int nFlags;
df = new DictField(tablenum(CustTable), fieldnum(CustTable, AccountNum));
if (df)
{
nFlags = df.flags();
if (bitTest(nFlags,#DBF_MANDATORY))
{
print ("The field is mandatory.");
}
else
{
print ("The field is not mandatory.");
}
}
Community Additions
ADD
Show: