static void literalLabelsFromEnum(Args _args) { #Properties SysDictEnum sysDictEnum = new SysDictEnum(enumNum(SysDimension)); TreeNode treeNode; int x; ; for (x = 0; x <= SysDictEnum.lastValue(); x++) { treeNode = TreeNode::findNode(sysDictEnum.path() + '\\' + sysDictEnum.index2Symbol(x)); print sysDictEnum.index2Label(x)+ ' ' + findProperty(treeNode.AOTgetProperties(),#PropertyLabel); } pause; }
A blog about any interesting "Microsoft Dynamics AX" and "Microsoft Dynamics 365 for Finance and Operations" stuff I come across.
Monday, January 7, 2008
Get the literal label of an enum value
I couldn't find a function in the standard to give me the literal label (@SYSxxxx) of an enum value, so I came up with this prototype: