community postAL Developmentcommunity - not Microsoftreviewed - checked by Opus

BC Friday Tips #47 Enum Display Order

Enum values in AL display in the order they appear in code, not by their ordinal values. This allows developers to rearrange enum values without needing to renumber ordinals.

post That NAV Guy

Teddy Herryanto · 2025-09-12 · 74 words · about 1 min

"Enum values in AL are displayed based on their order in the code, not their ordinal."

Key points

  • Enum display order is determined by code sequence, not ordinal numbers
  • Developers can reorder enum values without modifying ordinal assignments
  • Understanding this behavior prevents confusion when organizing enum values

Quotes

  • “Enum values in AL are displayed based on their order in the code, not their ordinal.” (This clarifies a fundamental misunderstanding developers might have about how enums are rendered in the UI.)
  • “You can rearrange values without renumbering the ordinals.” (This demonstrates a practical benefit of understanding enum display mechanics, enabling cleaner code maintenance.)

Context

  • Features: Enum value ordering

Source: That NAV Guy, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.