top of page

ENUM vs Options

  • marco ferrari
  • Feb 12, 2022
  • 1 min read

In the latest version of Business Central you can see that the Option data type fields have been converted into ENUM.

Let's see the Sales Header table:

ree

Let's take a view to the Enum "Sales Document Type":

ree

Compared with the past, we can note that the original sequence of the OptionMembers has been converted into the ENUM.

ree

This is true also for those options that have been modified in a localization process. We can make a comparison between the "Gen. Journal Document Type" of the W1 version

ree
The Gen. Journal Document Type of the W1 version

and the same ENUM of the Italian version:

ree

In this case to the "Dishonored" string has been associated the value 10, not 7 as we could expect. This is exactly the same value it had in the OptionMembers property:

ree

This is due to a compatibility problem with the former versions. As you probably know, the Option fields were simply integer into the SQL table, and the same is true for the ENUM data type, so they could not change the value without creating many problems (better to say a disaster) in the update process.

For this reason, if you customized an option field by adding some values at the end, now you have to use the "enum extension" object to add your value

ree

Going forward, if you want to add new values into a standard ENUM, never use the next value available, but use the same numbering you have for the customization/app, so you are sure that no one (standard or localization process) will use the same.

ree



 
 
 

Recent Posts

See All

Comments


©2022-2025 by Marco Ferrari

bottom of page