Friday, August 4, 2017

get values of base enums using code in x++

Question: How to get  values of base enums using code in x++

static void getEnumValues(Args _args)
{
    EnumId enumId;
    DictEnum dictEnum;
    int      count1;
    String15      enum;
   
    enumId   = enumNum(MonthsOfYear);
    dictEnum = new DictEnum(enumId);
    count1 = dictEnum.values();
    enum = enum2str(MonthsOfYear::June);
    info(strFmt("%1",dictEnum.name2Value(enum)));
}


output:

6

No comments:

Post a Comment

D365 Extensions: Extend the validateField Method on a Table

In this post I will going to show you, how to extend the validateField method on a table. As example I used the SalesLine, where I will ...