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, ...
Answered

Save enum label to a field

(0) ShareShare
ReportReport
Posted on by 903

Hi guys,

What will be the correct way of saving enum label to a field with string type ?

When I have a field, lets say MyProjInvoiceStatus (string) then in my code I want to keep the label, I found out I cannot use function Enum2Str()

I have a code that compare the status and when it meets the condition, I would directly put the enum like for example [mytable].MyProjInvoiceStatus = enum2Str(ProjInvoiceStatus::FullyInvoiced)

That one as mentioned is wrong, so what would be the correct way of doing it ?

Thanks,

.

I have the same question (0)
  • Martin Dráb Profile Picture
    239,360 Most Valuable Professional on at

    Why don't you simply store the enum as en enum?

    Do you want to store the actual text (such as "Invoiced" or a label ID (such as @SYS12345?

    If the text, do you realize that it will stopped being translated to user's (and customers' etc.) language? Are you sure you want it? If so, which language do you want to use?

  • Tony zhong Profile Picture
    903 on at

    Hi Martin,

    Yes, to simplify the table because it is for FACT table, and would like to use English as the international language.

    Thanks.

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

    How would it be simpler than actual enum value? To me it sounds like a design decision that will just hurt you in the future.

    Anyway you can use strFmt("%1", myTable.MyEnumField) to get the label in your language.

  • Tony zhong Profile Picture
    903 on at

    Hi Nikolaos,

    It would be simpler in regards of the data will be used for FACT table as it will need to de-normalized. There is no need to be in separate table like a master or lookup table for this statuses. By just exposed the description, we no need to take care what is the meaning of value 1/2/3. Also we do not need the index as we also do not need the order sequence.

    However understand your concern, as and when the value needed, I will just added it as another column. Thanks for the input.

    rgds,

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 632 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 624

#3
CP04-islander Profile Picture

CP04-islander 301

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans