axapta - How to get the number of values in an array in .Net? -



axapta - How to get the number of values in an array in .Net? -

ax allows arrays defined, while fetching info through .net business connector, shows single field. e.g: dimension set by:

axrec.setfield("dimension[1]","a"); axrec.setfield("dimension[2]","b"); axrec.setfield("dimension[3]","c"); // , on...

how know how many fields "dimension" have?

ax supports compile time function dimof homecoming count, not available .net!

to rescue comes dictfield class:

x++ code:

dictfield df = new dictfield(tablenum(custtable), fieldnum(custtable, accountnum)); if (df) { print strfmt("the arraysize %1.", df.arraysize()); }

you can create x++ utility function, phone call that:

static int arraysize(str tablename, str fieldname) { dictfield df = new dictfield(tablename2id(tablename), fieldname2id(tablename2id(tablename), fieldname))); homecoming df ? df.arraysize() : -1; }

axapta business-connector

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -