semantic_c0d3r
semantic_c0d3r

Reputation: 801

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.

Upvotes: 1

Views: 9643

Answers (2)

Skaue
Skaue

Reputation: 783

If you really want to do "reflection" over the extended data types, then the correct Class is DictType: http://msdn.microsoft.com/en-us/library/gg804354.aspx

Upvotes: 1

Björn Olievier
Björn Olievier

Reputation: 331

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

Upvotes: 3

Related Questions