Friday, July 6, 2018

How to get label from Enum Value in AX x++

Hi,
Below is the code we can use for getting the label for an enum.In this example I'm taking InventTransType enum.

    SysDictEnum dictEnum = new SysDictEnum( enumnum(InventTransType) ); 

   dictEnum.value2Label(InventTrans.TransType);

       or 
 // If you want to assign the label to string
   dictEnum.index2Name(InventTrans.TransType);

2 comments:

  1. In Microsoft Dynamics AX, use enum2Label to get the label of an Enum value. Alternatively, you can use enum2str switch free game if you need the text name instead of the label

    ReplyDelete

What is the primary purpose of using a Solution in Microsoft Power Platform & ALM?

As organizations embrace low-code development with Microsoft Power Platform , it becomes essential to manage and govern apps, flows, and dat...