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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Why does an enum support 251 values (and not 256)?

(1) ShareShare
ReportReport
Posted on by 2
"[Y]ou can declare up to 251 (0 to 250) literals in a single enum type"
 
This restriction seems rather odd to me. Why 251, specifically? Given how close it is in value to 256, it seems logical to conclude that enums are stored under the hood as bytes - but if so, why not let us use all 256 possible values?
I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    302,372 Super User 2025 Season 2 on at
    Hi JB,
     
     
    This is a design decision that comes from Dynamics AX version 1.0. It has never been changed anymore. Do you really need 256 enumerations?

    In the SQL database, it is not a byte, at least not anymore. It is stored as BigInt. In the past, I did a test and was able to write and read data with X++ coding using a value of 1000 and higher. I was bypassing the enumeration data type for this test.

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…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 438 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 358 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans