28 Mar 2013

Validate Table from X++

From the below code you can easily validate a table field using X++ code.

static server boolean validateTable(common _common)
{
boolean ret = true;
SysDictTable dictTable;
int fldCnt, i;
fieldId fid;
;
dictTable = new SysDictTable(_common.TableId);
fldcnt = dictTable.fieldCnt();
for(i = 1; i <= fldcnt; i++)
{
 fid = dictTable.fieldCnt2Id(i);
 ret = ret && _common.validateField(fid);
 }
  info(strfmt('Validation Result :%1',ret));
  return ret;
 }

No comments:

Create number sequence in D365 FO

Create the data type. Add code in the loadModule method of the appropriate NumberSeqModule subclass. Add a method to the module’s paramet...