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

Community site session details

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

Enum default value

(0) ShareShare
ReportReport
Posted on by 4,131

Hi,

I created an Enum with two values: Vendor product (enum value =0) , Customer product (enum value =1)

And now I want to create a third value - Default, and want to make Default's value to 0, it seems I could not really change it. Default value is always set to 2. Is there any way to change it?

Thanks,

I have the same question (0)
  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: Enum default value

    Two enum options can't have the same numerical value. So you would need to first change the numerical value of current option 0 to something else.

    However please be aware that such change would require you to update all your existing data because the enum values are stored as integer numbers in the database.

    However if you change property IsExtensible to Yes, you don't need to worry about numerical values anymore. Then you could try to simply move the enum elements (with Alt-Arrow) to change the default value. If you choose this path, I recommend you first deploy the IsExtensible: Yes change to prod, before starting to change the ordering of the enum values. Just to be on the safe side. At least try to test in your dev/test systems how your historical data behaves after your changes.

  • Yuji Profile Picture
    4,131 on at
    RE: Enum default value

    Hi Nikolaos,

    How to change the enum value, go to the XML file to change it?

    Thanks,

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: Enum default value

    You can change it in Visual Studio.

  • Yuji Profile Picture
    4,131 on at
    RE: Enum default value

    I could not find Enum Value on the Properties from Visual Studio IDE.

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: Enum default value

    Then where are you getting the values that you mentioned in your first message? What do you mean by "Default value is always set to 2"? If you don't see such values in VS, then your enum is already extensible, you don't need to care about numerical values, and you should be able to move any value as the first (default) one.

    If you still have questions, could you please share screenshots of your situation to help us understand better.

  • Yuji Profile Picture
    4,131 on at
    RE: Enum default value

    Hi Nikolaos,

    You are correct. If it is extensible, the values are not shown on VS, but I can move it up using the Alt+Arrow.

    Thanks a lot for your help,

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,100

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 633 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans