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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to store Enum label instead of Enum value in D365 finance and operation

(0) ShareShare
ReportReport
Posted on by


I want to store enum label rather than enum value in my DB side. for example i have one base enum "Status" value of this enum is (0  for Open , 1 for Closed ). in DB i want to store open and closed instead of 0 or 1. i found one code for the same. if this is the correct way to implement , in which method i should write this code. Please advice if there is any other way to achieve it

SysDictEnum dictEnum = new SysDictEnum( enumnum(InventTransType) );

dictEnum.value2Label(InventTrans.TransType);

I have the same question (0)
  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    moved to the d365 forum

  • Blue Wang Profile Picture
    on at

    Hi Sachin,

    AX stores enums as integers in DB.

    So I think you cannot store label for that.

    Why are you need to store label?

  • Community Member Profile Picture
    on at

    Hello Blue ,  Actually i am using this table in one MS Flow (Power Automate), that flow send records of this table through email and record value appears in Email body for now it is appearing as enum value as 0,1,2.. not the label.

    Other way is i have to use cases in SQL script to assigning label to the  values but i am avoiding that. i want to store value as label in the DB itself if possible.

    Please check this link (Link)

  • Community Member Profile Picture
    on at

    Hi Sachin,

    You can directly use Enum2Str().

    Neither I don't think it's a good way to directly store the label in db.

  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Enums are always stored as integers as others have pointed out. Each enum value maps to exactly one integer number but it can map to 50 labels (which might also change).

    How it's stored is one thing, and how you present it in your Power Automate is another. But you should focus your efforts in showing it in the format that you need.

  • Community Member Profile Picture
    on at

    Hello Nikolaos, Thanks for the detailed advice. i am now working on displaying enum as per my requirement rather than changing it on DB Side

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans