Blog

Name is Anant Dubey and the intent to create this blog is to discuss the problems and issues that developer face in the dynamics AX development and to share the new things that come up with the new version of AX.

Sunday, October 10, 2021

Get All Enum Values in d365

 DictEnum dictEnum = new DictEnum(enumNum(SalesStatus));

Counter  c;
;

for (c = 0; c < dictEnum.values(); c++)
{
    info(strFmt('%1: %2', dictEnum.index2Symbol(c),
                          dictEnum.index2Label(c)));
}

This will output the symbol and label of each element in the enum to the infolog.


Ref: - https://www.miklix.com/dynamics-ax/how-to-iterate-over-the-elements-of-an-enum-from-x-code-in-dynamics-ax-2012/

No comments:

Post a Comment