web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to get the EnumType used on a field in a Table

(2) ShareShare
ReportReport
Posted on by 2,477
Hi,
 
Let's say there's a table TableA and it has field Field1 which is an Enum Field.
 
How can get the Enum name of the Field1 with X++ or T-SQL (Which is present in the EnumType in the field properties in Visual Studio).
 
Appreciate any tips.
 
Thanks.
 
 
  • Suggested answer
    Layan Jwei Profile Picture
    8,401 Super User 2026 Season 2 on at
    Hi MYGz,

    Is this what you are looking for? -- I tried it with the enum "FedNonFedIndicator" in CustTable and it gave me the enum name which is "FederalNonFederalIndicatorCode"
      
            FieldId    fieldId   = fieldNum(CustTable, FedNonFedIndicator)
            DictField  dictField = new DictField(tablenum(CustTable), fieldId);
    
            EnumId  enumId = dictField.enumId();
            if (enumId)
            {
                info(enumId2Name(enumId));
            }


    Thanks,
    Layan Jweihan
  • Layan Jwei Profile Picture
    8,401 Super User 2026 Season 2 on at
    Hi MYGz,

    Is your question answered? if yes then please verify the answer if it helped

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 536 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 363 Super User 2026 Season 2

#3
CU-1234529-002 Profile Picture

CU-1234529-002 188

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans