any2Enum Function [AX 2012]
Updated: March 11, 2014
Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012
Converts an anytype value to the Name property value of an element in the target enum.
enum any2Enum(anytype object)
static void any2EnumExample(Args _args)
{
NoYes myNoYes; // NoYes is an enum.
int i;
str s;
i = 0; // An int that will be converted.
myNoYes = any2Enum(i);
Global::info(strfmt("'%1' - is the output, from input of the %2 as int.", myNoYes, i));
s = "1"; // A str that will be converted.
myNoYes = any2Enum(s);
Global::info(strfmt("'%1' - is the output, from input of the %2 as str.", myNoYes, s));
/**** Infolog display.
Message (01:05:32 pm)
'No' - is the output, from input of the 0 as int.
'Yes' - is the output, from input of the 1 as str.
****/
}
Announcements: To see known issues and recent fixes, use Issue search in Microsoft Dynamics Lifecycle Services (LCS).
Community Additions
ADD
Show: