Uncategorized

When you have enum name and name value but want to have an int

Some part of code where taken from https://community.dynamics.com/ax/f/33/t/86432

I was looking for this little piece of code for too long to let it go.

So pretty much this code can be helpful. Enjoy

 Common common;

DictEnum dictEnum = new DictEnum(enumName2Id(“NoYes”));

info(int2str(dictEnum.name2value(“No”)));//<– that is label, not the name of the field

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s