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 add new element to base enums in run time.

(0) ShareShare
ReportReport
Posted on by 157

I had a requirement in which I have to add the enum values to the enum in the run time.

For that I have to add the enum values to the xml.

Can any suggest how to add the enum values to the xml.

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    You can't change the AOT objects (code, metadata) in runtime.

    The source code (xml) only exists in a dev system. Then you build a binary (.dll) out of it, and this binary is used in runtime.

    In test/prod systems only the binaries are present. Not source code.

    However you can have lookups in your form, that you construct in runtime. So perhaps that would solve your business requirement.

    What is your business requirement?

  • Neetha Profile Picture
    157 on at

    If user enters an enum value in one dialog form, that enum value should get added to the base enum.

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

    That's not possible. Base enums are fixed lists. If you need a dynamic list for selection / lookup, you need to create a table where your user can define these values. Then create table relation to this table, from all tables where you want to use this lookup.

    The standard system is full of examples, you can check them. For example Payment terms, Customer groups.

  • Suggested answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    Your understanding of how enum works/ enum is wrong. Enum type fields are used when you have a fixed set of values. In your case user is going to enter a value and that value can differ every time they enter, so better you create a set up form as Nikolaos mentioned and use it.

  • Neetha Profile Picture
    157 on at

    Thank you Nicholas for this work around.

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 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans