Wednesday, August 2, 2023

Code to get Table Fields and Fieldcount in D365 X++

 

public static void main(Args _args)

   {

       dictTable   dt;

       DictField   df;

       int         numberOfFields,fieldId,i;

 

       dt = new dictTable(tablename2id("DaxTable"));

       numberOfFields = dt.fieldCnt();

       for (i = 1; i <= (numberOfFields); i++)

       {

           fieldId = dt.fieldCnt2Id(i);

           df = dt.fieldObject(fieldId);

           info(df.label());

       }

   }

Output :








No comments:

Post a Comment