Skip to main content

Base Enum Extensions

A Base Enum Extension (AxEnumExtension) modifies an existing base enumeration without altering its original source code. Enum extensions allow you to add new values to standard enumerations and modify properties on existing values — enabling customisation while preserving upgradeability.

Enum extensions are created by right-clicking a base enum in the AOT and selecting Create extension. This creates an AxEnumExtension object named <OriginalEnumName>.<YourModelName> in your model.

What Can Be Extended

CapabilityDescription
Add Enum ValuesNew values appended to the enumeration.
Modify Existing ValuesChange properties (Label, HelpText) on existing values via ValueModifications.
Modify Enum PropertiesChange top-level properties via PropertyModifications.
warning

Enum extensions cannot remove existing values or change value integers. New values are assigned integers automatically by the system to avoid collisions across extensions.

Extension Naming Conventions

PatternExampleDescription
Extension objectSalesStatus.SAMOModelBase enum name + dot + your model name.
New valuesSAMOPendingReviewPrefix with your solution abbreviation.

Best Practices

  • Always prefix new values with your solution abbreviation to avoid collisions with other extensions.
  • Do not rely on integer values of extension enum values — they are auto-assigned and may change between builds.
  • Use switch with default — always include a default case in switch statements on extensible enums, since other extensions may add values your code does not recognise.
  • Set IsExtensible = Yes on custom enums you create if other models may need to extend them.

Working with Extensible Enums in Code

Extensible enums require special handling because the set of values is not known at compile time:

// WRONG — do not compare against a hardcoded integer
if (salesTable.SalesStatus == 3)

// CORRECT — always use the symbolic name
if (salesTable.SalesStatus == SalesStatus::Invoiced)

// CORRECT — handle unknown values in switch
switch (salesTable.SalesStatus)
{
case SalesStatus::Backorder:
// ...
break;
case SalesStatus::Invoiced:
// ...
break;
default:
// Handle values added by extensions
break;
}

Properties

4/4 properties
PropertyDisplay NameTypeDescription
Enum ExtensionAxEnumExtension
NameNameStringThe name of the extension element (follows BaseEnum.Package naming).
IsObsoleteIs ObsoleteNoYesWhether the extension is deprecated. Values: No (0), Yes (1).
VisibilityVisibilityCompilerVisibilityAccess level visibility. Values: Private (0), Protected (1), Public (2), Internal (3), InternalProtected (4).
TagsTagsStringTags for this element separated by semicolon.