Enum extensions
Less than to read
A standard local menu can be extended and customized with specific values for any specific requirement.
Three cases can be highlighted:
Context 1: A standard Enum exception already exists for the extended Local menu
You can add new specific values on a standard Local menu, but the standard Enum exception must be updated as well:
- Partners or customers must fill-in the new Enum value and Package name for the extension to be added in the API.
- On the example below, two specific values have been added to the standard Local menu 365 and highlighted in yellow. The Enum exceptions are highlighted in blue in the example below:
In VS Code, the code generator uses this information to populate the extension for the standard Enum in the specific package.
Notes
- On a standard Local menu, only adding new values after the standard ones is supported.
- Removing standard values in a Local menu or in an Enum exception is not supported.
- Inserting specific values between standard Local menu values is not supported.
- Adding, removing or renaming specific values afterward on an Enum exception requires the Enum exception to be fully refreshed. You can do this by first deleting all the existing specific values and recreating them from scratch.
Context 2: No standard Enum exception exists yet for the extended Local menu
If no Enum exception exists for the standard Local menu, partners or customers can create it to add the new Enum values and associated packages.
After the modifications of the Standard Local menu are done, the following list of events occurs when the associated Enum exception is created:
- The Enum exception header will be automatically initialized.
- The standard Enum values will be automatically initialized.
- Only the specific values for Enum value and Package name must be manually defined. The standard values will remain protected and non-editable.
In VS Code, the code generator uses this information to populate an extension for the standard Enum in the specific package.
Note: If a standard Local menu is not delivered yet by Sage in the API GraphQL schema, the code generator fails and returns an error.
Context 3: The standard Local menu is marked as changeable
Changeable Local menus are managed in the same way as other Local menus. This means only new values can be added as extensions.
Note: The standard Sage values will not be overridden in the GraphQL schema even if they are marked as changeable.