Enums
Less than to read
Enums are the GraphQL equivalent of Sage X3 Local menus or lists of values.
Since release 2024 R2/V12.0.36, standard Local menus are generated as enums in API packages. Therefore, they are available for partners developments.
The Local menu description (en-US) is used to build the Enum name. For duplicated Local menu descriptions, the Enum name is based on the Local menu description suffixed with the Local menu number to distinguish the Enums. The PascalCase convention is automatically applied to the Enum name.
Some local menus can’t be translated as they are in X3. In those cases, they should be managed as exceptions using the Enum exception function (GESAENUMB). This is done for the following cases:
- The Enum is included in different package from the package associated with the Local menu’s module.
- The Local menu description or values do now follow GraphQL naming rules.
The following example shows a Local menu being managed through an Enum exception:
In the above example:
- The name of the Enum has been modified by Sage.
- The package of this Enum has been changed to
x3-master-data
. This is different compared to the module of Local menu's. - Enum values have been adapted because original texts contain special characters.
When Node bindings are validated and package generation is finished, a file is created for each Enum in the lib/enums folder. This folder is in the directory of the package defined for the Enum.
In the case of the presented example, the folder is node_modules/@sage/x3-master-data/lib/enums/related-company-settings.d.ts
:
|
This code is automatically generated from X3.