Showing posts with label Type Conversions in Ax 2012. Show all posts
Showing posts with label Type Conversions in Ax 2012. Show all posts

Thursday, 12 May 2016

Type Conversions in Ax 2012

Enum2int() Method

static void Datatypes_enum2int(Args _args)
{
    SalesType salesType;
    salesType = SalesType::Sales;
    info(strfmt("The value of the current sales-type element is %1",enum2int(salesType)));
}

Enum2Str() Method

static void Datatypes_enum2str(Args _args)
{
    SalesType salesType;
    salesType = SalesType::Sales;
    info(strfmt("The name of the current sales-type is '%1'", enum2str(salesType)));
}

anytype
static void Raj_anytype(Args _args)
{
    anytype any;
    any = "ABC";
    print any;
    any = 55;
    print any;
    any = systemdateget();
    print any;
    pause;
}