A blog (primarily about Dynamics AX/D365) covering topics like X++, AX for Retail, D365 Commerce, Trade and Logistics, retail concepts, warehousing, etc. Something for everyone. Grab bag blog for whatever I think would help out people in the Dynamics AX/Commerce/Retail community. The opinions expressed on this site are my own and do not necessarily represent the views of my company
Tuesday, February 9, 2010
Find the length of an Extended Data Type in X++
Need to find the string length of a property in the AOT (e.g. AccountNum is a string size of 20). Below is some code that will do this for you. It will also allow you draw out some other properties of the EDT if you need to.
static void Job1(Args _args)
{
str edtName = 'NAME_OF_EDT_OBJECT'
Dictionary dictionary = new Dictionary();
DictType dictType = dictionary.typeObject(dictionary.typeName2Id(edtName));
;
info (strFmt('Size of %1: %2', edtName, dictType.stringLen()));
}
Subscribe to:
Post Comments (Atom)
Hey, just thought you should know.
ReplyDeletedictType.stringLen()