Search code examples
dynamics-ax-2009x++

How to get extended data type in AX [X++]


I am using the following code to get type of a field. How do I get "extended type"

tID = dict.tableName2Id('CustTable');
dt = new DictTable(tID);
if (dt)
{
    fId = dt.fieldName2Id('CustGroup');
    df = dt.fieldObject(fId);
    if (df)
    {
        t = df.type(); // Need to get extended data type
        print enum2str(t);
        pause;
    }

}

Kindly help.


Solution

  • Use typeId() instead of type() to get the ID of the extended data type. With extendedTypeId2Name() you can then find its name.