Dynamics AX 2012 SQL Extraction of Base Enum Values

Luke Wyatt picture Luke Wyatt · Jan 8, 2013 · Viewed 12.1k times · Source

Is there a table, view, or procedure I can use to extract the values from a Base Enum using SQL (straight from the DB, not within X++)? I was able to find an isolated few in the table SRSAnalysisEnums but not the enum I need in particular.

Answer

Jan B. Kjeldsen picture Jan B. Kjeldsen · Jan 8, 2013

Looping over enums is dead easy:

static void EnumIteration(Args _args)
{
    DictEnum enum = new DictEnum(enumName2Id("TestEnum"));
    int i;
    for (i=0; i < enum.values(); i++)
    {
        info(enum.index2Label(i));
    }    
}

Roll it on your own table.