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 :
Small and medium business | Business Central, N...
Suggested Answer

Change custom fields type from Option -> Enum

(0) ShareShare
ReportReport
Posted on by 21
Hi,
 
     I was wondering if Microsoft is changing standard Option fields into Enum, should we do it also?
 
In BC25 Could version we have this field:
 
 
This is clearly an old field that before was an option and now is an Enum. If I open the sales order, is still option as it was originally.
 
 
If I Check Fields table: 
 
OptionMembers = TableFilter,RecordID,OemText,Date,Time,DateFormula,Decimal,Media,MediaSet,Text,Code,Binary,BLOB,Boolean,Integer,OemCode,Option,BigInteger,Duration,GUID,DateTime;
There is No ENUM in this list.
 
For the breaking change Microsoft says:
This statement is a warning and is related to when you make a new field of type Enum and copy values from Option. As long as Option and Enum have same values, this warning should be no problem. Also, I tried, and changing custom fields from Option to Enum is nor an error or warning for AppSourceCope, also deploying change into Cloud environment the existing values in Option field are not lost.
 
Still I have this Question:  Is it a breaking change if I Replace Option type of field with Enum directly, NOT to create a new Enum field and copy values from Option, that Microsoft says in the above link is a warning.
 
 
 
I have the same question (0)
  • Suggested answer
    Bilal Haider Profile Picture
    442 on at
    Hi,
     
    Interesting post! I never noticed that in page inspection the document type shown is still option although in table definition its an enum. 
     
    If you are replacing option type with enum then it is actually recommended by Microsoft. Also using enums make our lives easy as then we need to maintain only at one place. like if a new value is added, or value is being updated.
  • Suggested answer
    Kamal Khakhkhar Profile Picture
    2,492 on at
    Hii there,
    As per requirement you can update data type from option to enum it's not make any error. You need to add all the options members to enum and then update the some of code as per enum . It will work. Even though you are worried about your data create new field . Move data to that field and obsolete the old field.
     
    Thank you.
    Kamal Khakhkhar
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    21,593 Super User 2026 Season 1 on at
    Replacing an Option with an Enum is safe if you preserve the same ordinal values (order and numbering) of the original Option members. 
  • Gerardo Rentería García Profile Picture
    25,547 Most Valuable Professional on at

    Hi, good day
    I hope this can help you, and give you some hints. It's time to Enumify your Option fields in AL and Business Central

     

  • Suggested answer
    Inkey Solutions Profile Picture
    2,102 on at
    Hello, 

    If the field data type is either Enum or Option, it will always appear as an Option in the table field of Business Central.

     
    When replacing an option field with an enum field, the ordinal values must match those of the original option members. Changing these values can cause data inconsistencies and corruption during upgrades. Additionally, extensions relying on specific ordinal values may fail if altered in the enum field.

    To resolve this error, follow these steps:
    1. Locate the enum field in your code that is replacing an option field.
    2. Ensure that the ordinal values of the enum members match those of the original option members.
    3. If the ordinal values don't match, adjust the enum members to preserve the original ordinal values.
    Thanks.

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,744 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,068 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 596 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans