Classes
A class defines a data structure that encapsulates the properties and behaviors of a specific entity, such as a customer, a general ledger entry, a product, or a sales order.
The Classes function (GESACLA) enables users to create and update classes. It populates dictionary tables and generates code via a validation function. Before a class can be used in code or visual representations, it needs to be validated. If validation fails, an error will be triggered during execution.
Prerequisites
Refer to the implementation documentation.
Screen management
The screen is defined in 7 tabs:
Header
| Class code (CODCLA) |
|
A unique identifier used to reference and manage classes within the system. |
| Description (ZINTCLA) |
|
A brief label that explains the purpose of the class. |
General tab
This tab provides general information about the class and includes two key grids:
Collections grid
This grid displays all collections managed within the class. Collection codes are assigned in the Properties tab and can refer to:
-
Simple properties that represent arrays of attributes. For technical reasons, a child class containing these properties is automatically generated. Its instance is named COLLECTION.
-
Child classes that define a collection of nested class instances.
Scripts grid
This grid lists all scripts associated with the class. Development partners can use the $METHODS and $PROPERTIES labels to insert custom code tied to supervisor events, particularly for CRUD operations (Create, Read, Update, Delete).
Management mode
| Type (TYPCLA) |
|
Defines how the class behaves and under what conditions it can be used. The type determines its relationship with the database, the availability of methods and accessors, and its role within the system. Persistent Represents an entity stored in the database. Standard operations such as Create, Read, Update, and Delete (CRUD) are available and can be managed by the Sage X3 supervisor layer. This type supports both accessors and methods. Interface Used for manually managing CRUD operations. It is not linked to database tables but still supports accessors and methods. Basic Supports accessors and methods but does not allow mappings. Typically used for child classes within a persistent class structure. Technical Represents an entity where methods can be defined, but accessors are not available. Properties of this class type cannot be displayed in representations. System Defines a data structure without accessors or methods. Properties of system classes are not visible in representations. |
| Table - view (WTABREF) |
|
Applicable only to persistent classes. It defines the main table on which the CRUD operations are performed. The other tables are defined in the Mapping tab. |
| Index (WINDREF) |
|
Specifies the database index used to define the class key and determines which table fields uniquely identify records for CRUD operations. This field is only applicable to persistent classes. |
| Keys (KEYINT) |
|
Displays the key structure used to identify records, depending on the class type:
|
| Transaction management (FLGTR) |
|
Indicates whether operations on the class are executed within a database transaction. Ensures data consistency and rollback capability in case of errors. This field is only applicable to interface classes. |
| Activity code (CODACT) |
|
Defines whether the class is protected during standard patching (if the code starts with X, Y, or Z) or marked as optional. It behaves like all activity codes defined in the dictionaries. If left empty or if the code is active, the structure is generated. |
| Module (MODULE) |
|
Technical module to which the representation is associated. |
| In cache (FLGBUFFER) |
|
When selected, marks the class as hidden. Hidden classes are not exposed in representations or standard interfaces, and are typically used for internal or technical purposes. |
| Searchable (FLGSEARCH) |
|
When selected, enables the class data to be indexed by the search engine for properties marked as Searchable. Applicable only to persistent classes. |
Collections grid
| Code (CODCOL) |
|
Unique identifier for the collection within the class. Used to reference and manage the collection's structure and behavior. |
| Description (INTITCOL) |
|
A brief label for the collection. Helps identify its purpose or contents within the class structure. |
| Min no. (MINCOL) |
|
Specifies how the property array is allocated in memory for class instances.
Used to control memory usage and structure initialization. |
| Act (ACTCOL) |
|
If specified, this sizing activity code defines the maximum size of the collection dynamically. It enables automatic memory allocation during processing, eliminating the need for manual memory adjustments. |
| Max no. (MAXCOL) |
|
Maximum size of the collection. The maximum size is mandatory only when the collection is used by properties and not by an instance. If you define a maximum number, the number of created elements is limited.
|
| Sequence number (PROCOL) |
|
This field refers to the property of the class that stores the number of lines created in the collection. |
| Insertion (FLGINSCOL) |
|
If this check box is selected (Insertion = yes), lines can be inserted on the collection. This will be used as the default value on the representation based on the class, but you can change this value (Insertion = no) on the representation. The corresponding method is called ADDLINE. |
| Deletion (FLGSUPCOL) |
|
Select this checkbox to enable line deletion within the collection. This setting will be used as the default value on the representation based on the class, but you can change this value on the representation. The corresponding method is called ADDELLINE. |
| Sort (FLGTRICOL) |
|
Select this checkbox to enable line sorting within the collection. This setting will be used as the default value on the representation based on the class, but you can change this value on the representation. The corresponding method is called ASORT. |
| Addition (FLGAPDCOL) |
|
Select this checkbox to enable the insertion of lines at the end of the collection. This will be used as the default value on the representations based on the class, but you can change this value on the representation. The corresponding method is called AINSERT. |
Scripts grid
| Type (TYPTRT) |
|
Indicates the origin of the script.
|
| Scripts (CODTRT) |
|
This is the name of the script. Follows the class_Cyyyy naming convention, where:
This ensures consistent identification and categorization of scripts. |
| Running order (RANTRT) |
|
Order in which the $METHODS and $PROPERTIES labels are called during the event. |
| Activity code (ACTTRT) |
|
Used to protect the script during standard patching (if starting with X, Y, or Z) or to control its activation. When active, the script is executed. When inactive, the call is skipped. |
Methods tab
This tab defines additional methods and operations available on the class.
-
Operations: Executable in any context using an index code and key values to build the context it operates on. An operation can be called through a link in the interface from any page when the key values are provided.
-
Methods: Require an existing context and operate on the current entity instance.
The Methods tab includes 3 grids:
-
Methods grid: Lists the methods and operations with their information.
-
Parameters grid: Displays the parameters for the selected method or operation.
-
Keys grid: Lists key segment parameters for the selected operation.
Methods grid
| Code (CODMET) |
|
Identifies the name of the method or operation callable on the entity. At runtime, this value is stored in the ACTION variable when the corresponding event is triggered in the $METHODS label, provided CURPTH = "". |
| Description (INTITMET) |
|
A short description to help understand the context and intended use of the class. |
| Return type (DONMET) |
|
Specifies the data type of the value returned by the method or operation. This corresponds to the type of the ARET_VALUE variable used in the event linked to the method. It determines how the returned result is interpreted and processed. |
| Activity code (ACTMET) |
|
Code used to protect the method during the standard patching process if the code starts with X, Y, or Z, or to activate/deactivate the method in the class. |
| Operation (FLGOPE) |
|
If this checkbox is selected, the line refers to an operation. If not, the line refers to a method. |
| Index (INDOPE) |
|
Required only for operations, this field specifies the default access index used to retrieve class instance values during a Read operation. It determines which key segments are needed when a representation link triggers the operation, ensuring the correct context is built for execution. |
Parameters grid
| Code (CODPARMET) |
|
Specifies the name of the variable that holds the parameter value during execution. This variable is accessible in the code triggered by the $METHODS event and is used to pass contextual data to the method or operation. |
| Type (TYPPARMET) |
|
Indicates the data type of the parameter passed to the method. This corresponds to the keyword used in the variable declaration and determines how the method interprets the incoming value. |
| Description (INTITPARME) |
|
Provides a brief explanation of the variable’s purpose and usage within the method or operation. |
| Method (MODPARMET) |
|
Specifies how the parameter is transmitted during the method or operation call:
|
| Dim. (DIMPARMET) |
|
Specifies whether the parameter is an array and defines its starting index:
This setting ensures correct handling of parameter values during method or operation execution. |
| Class (CLAPARMET) |
|
Specifies the class to which the parameter belongs when its Type field is set to Instance. |
Keys grid
| Code (CODCLEOPE) |
|
Key segment name. |
| Type (TYPCLEOPE) |
|
Data type of the key segment, based on recognized variable declaration keywords. Only data types supported by the database segment keys are allowed. |
| Description (INTITCLEOP) |
|
Description of the key segment’s purpose or role. Helps clarify its function in the context of the operation. |
Standard methods tab
This tab describes the availability of the standard CRUD operations and any additional methods provided by the supervisor layer for this class.
Grid
| Code (CODMETSTD) |
|
Displays the initial letter of each method to indicate its type. For example, C for Create. This code is restricted to internal use only. |
| Description (INTITMETST) |
|
Displays the full name of each method. For example, Create for the C method. |
| Activity code (ACTMETSTD) |
|
Allows disabling a method by assigning an activity code. If the assigned activity code is inactive at runtime, the method will be unavailable, regardless of the value of the checkbox. |
| Y/N (ENAMETSTD) |
|
When selected, this checkbox disables the method and prevents its code from being generated in the class. |
Properties tab
This tab contains the 3 following grids:
-
The Properties grid lists the properties of the class.
-
The Parameters grid displays the parameters associated with the selected property in the Properties grid, if the property type requires additional parameters based on predefined rules. Entering values here is necessary to ensure the rule is executed correctly in context.
-
The Keys grid lists the key segments related to the selected property in the Properties grid, if the property type is linked to a table (version 6 technology) or a persistent class.
Properties grid
| Property (FLDCLA) |
|
Specifies the name of the property, which is used in Sage X3 scripts. If the class is persistent, it is strongly recommended to name properties identically to the corresponding columns in the database tables used for data storage. Failing to do so will require additional code to map class properties to the data retrieved from the database cursor during CRUD operations. |
| Order (NUMFLD) |
|
Determines the chronological order in which the init and control methods of the structure are generated. Methods are created following the sequence defined by the value of this field. |
| Description (ZINTFLD) |
|
You can use this property description when designing user interfaces through representations. |
| Short description (ZINTSHTFLD) |
| A brief label for the property. |
| Type (CODTYP) |
|
Specifies the data type of the field. Depending on the selected data type, additional information can be required:
If this field is left empty, you need to reference the property through an instance of the child class. |
| Menu (NOLIB) |
|
Specifies the number of the local menu to use when the internal type of the selected data type is Local menu (M). This number defines the set of available values for the property. For example, menu 1 corresponds to the Yes/No options. |
| Length (LONG) |
|
Use this field to specify the field length, if this latter is not specified on the data type and if the data type allows it. For example, absence of format, local menu, and so on. For string values, enter the number of characters. For numeric values, use the N.M format, where:
|
| Act (ACTFLD) |
|
Defines the activity code that controls whether the field is generated.
|
| Class (LNKCLA) |
|
Specifies the name of the class associated with the property, if the property is a class instance. You can enter a class name only if the Type field is empty. In this case, the class name becomes mandatory. |
| Collection (FLDGRP) |
|
Specifies the collection to which the property belongs.
|
| Lob table (LOBTAB) |
|
The Lob table and Lob field fields specify where rich media elements (CLOB/BLOB data) are stored. If the data type is CLOB or BLOB and managed by the supervisor, these fields indicate:
Based on the selected table, the Keys grid is automatically populated to enable proper joins using key values. If the data type is not managed by the supervisor, you cannot fill these fields in. In such cases, a custom program must handle the join logic manually. |
| Lob field (LOBFLD) |
|
The Lob table and Lob field fields specify where rich media elements (CLOB/BLOB data) are stored. If the data type is CLOB or BLOB and managed by the supervisor, these fields indicate:
Based on the selected table, the Keys grid is automatically populated to enable proper joins using key values. If the data type is not managed by the supervisor, you cannot fill these fields in. In such cases, a custom program must handle the join logic manually. |
| Content type (LOBCNT) |
|
Displays the content type associated with the selected data type. |
| Mandat (OBLIG) |
|
Indicates whether the property is mandatory. When set to Yes:
|
| Control table (CODCTL) |
|
Use this field to perform additional consistency checks through a simple setup. This feature is intended for customization purposes and allows for extended validation logic beyond standard controls. Updating this field does not require protection by an activity code. |
| Dependency (TABCONT) |
|
Defines a property used when the control table depends on another table. |
| Access code (ACS) |
|
Defines the access control code used to manage user permissions for this property, based on configuration settings. |
| Searchable (FLDSEARCH) |
|
Indicates if the field is included in the search index. The field will be indexed only if you select this checkbox. Clearing this checkbox does not remove indexing information from each line. This allows temporary deactivation of indexing without losing the configuration details of which fields are intended to be indexed.
|
| Category (CATSEARCH) |
|
Defines a category used to filter search results. For example, if you create a category called SALESREP and assign it to the Sales rep field in a customer record, this same field can also exist in related entities like sales orders and sales invoices. When searching for MARTIN, and if MARTIN is a sales rep listed in:
Selecting the SALESREP category will restrict the search results to only those records, even if MARTIN appears in other unrelated entities. Categories are defined in miscellaneous table number 16. |
| GET accessor (FLGACCGET) |
|
Select this checkbox to generate a GET accessor calling code on the property. This setting can be changed at any time in the dictionary, including in standard classes. If selected, this checkbox will not be deactivated by any patch, ensuring the accessor remains active even after updates. Select this checkbox only for properties where it is truly necessary. Generating GET accessors for every property can negatively impact runtime performance, especially in large or complex classes.
|
Parameters grid
| Code (CODPAR) |
|
Displays the automatically generated code for each parameter. This code is system-defined and you cannot modify it manually. |
| Description (INTITPAR) |
|
Displays the automatically generated description for each parameter. This description is system-defined and you cannot modify it manually. |
| Type (TYPINTPAR) |
|
Displays the automatically generated data type for each key segment. This type is system-defined and you cannot modify it manually. |
| Method (ADRVAL) |
|
Defines how the parameter is transmitted during the call. This setting is system-defined and you cannot modify it manually.
|
| Value (VALEUR) |
|
Specifies the formula that provides the value for the parameter. Some restrictions apply, as the formula must be evaluated in the client context. |
Keys grid
| Code (CODCLE) |
|
Displays the column name of each key segment. This value is system-defined and you cannot modify it manually. |
| Description (INTCLE) |
|
Displays the description of each key segment. This value is system-defined and you cannot modify it manually. |
| Type (TYPCLE) |
|
Displays the data type of each key segment. This value is system-defined and you cannot modify it manually. |
| Value (VALCLE) |
|
Specifies the value assigned to the key segment. You can modify this value if necessary. |
Mapping tab
This tab defines how CRUD operations (if available) are linked to the database tables for the main class instances and their child class instances. You can enter information only if the class is Persistent.
Main table
| Table (TABREF) |
|
Identifies the main table from which other tables are accessed through direct links or cascades. This field is populated automatically based on the main table defined in the General tab of this function. |
| Index (INDREF) |
|
This field is automatically populated according to the index and description defined in the General tab of this function. A short description displays next to this field. |
| Reading (FLGRREF) |
|
Select this checkbox for the generated program associated with the class to manage the Read operation. If cleared, the development partner must write the code for reading the data from the main table in the corresponding AREAD event. |
| Creation (FLGCREF) |
|
Select this checkbox for the generated program associated with the class to manage the Create operation. If cleared, the development partner must write the code for reading the data from the main table in the corresponding AINSERT event. |
| Modification (FLGUREF) |
|
If this check box is selected, the generated program associated with the class will manage the 'Update' operation. If cleared, the development partner must write the code for reading the data from the main table in the corresponding "AUPDATE" event. |
| Deletion (FLGDREF) |
|
Select this checkbox for the generated program associated with the class to manage the Delete operation. If cleared, the development partner must write the code for reading the data from the main table in the corresponding ADELETE event. |
| Filter (FLTREF) |
|
You can define a formula used to filter the data. The formula can only reference columns from the main table associated with the class. |
Table joins grid
| Reference (REFLNK) |
|
Specifies the reference of the property belonging to the child class. |
| Class (CLALNK) |
|
Class code associated with the property reference. This field is filled in automatically and cannot be modified. |
| Destination table (TABLNK) |
|
Identifies the table that is linked to the table of origin. |
| Abbrev. (ABRLNK) |
|
Specifies the abbreviation under which the linked destination table is opened. If left blank, the table’s default abbreviation is used. This field is useful when the same table appears multiple times in the grid, as each linked line must have a unique abbreviation to be opened simultaneously. |
| Origin table (TABORI) |
|
Identifies the main table at the origin of the link described on the current line. This can be the main table or one of the linked tables from previous lines. |
| Abbrev. (ABRORI) |
|
Specifies the abbreviation under which the linked origin table is opened. If left blank, the table’s default abbreviation is used. This field is useful when the same table appears multiple times in the grid, as each linked line must have a unique abbreviation to be opened simultaneously. |
| Link type (TYPLNK) |
|
Indicates the relationship between the origin table and the linked table. Possible values:
|
| Main index (CLELNK) |
|
Defines the table key code used to read the linked lines. By default, the first key of the table is used. |
| Sort index (CLESORT) |
|
This field defines the initial order of the lines when a Read operation is performed on a class instance. If left blank, the main index is used. |
| Join expression (EXPLNK) |
|
Specifies one or more calculated expressions (separated by semicolons) used to determine the key value for performing the join.
|
| Selection expression (EXPSEL) |
|
Defines a formula applied to the table specified in the Linked table column to filter data in the template.
|
| Activity code (ACVLNK) |
|
Specifies the activity code used to protect modified or specific lines in the grid, or to disable lines when the associated activity code is inactive. |
| Class management (FLGA) |
|
This checkbox determines how CRUD operations are implemented:
|
| Del/ins management (FLGV) |
|
This checkbox determines how updates on lines are processed:
|
| Reading (FLGR) |
|
This checkbox indicates whether the generated program associated with the class will handle the Read operation.
This checkbox is available only if the Management by class checkbox is cleared.
|
| Creation (FLGC) |
|
This checkbox indicates whether the generated program associated with the class will handle the Create operation.
This checkbox is available only if the Management by class checkbox is cleared.
|
| Modification (FLGU) |
|
This checkbox indicates whether the generated program associated with the class will handle the Update operation.
This checkbox is available only if the Management by class checkbox is cleared.
|
| Deletion (FLGD) |
|
This checkbox indicates whether the generated program associated with the class will handle the Delete operation.
This checkbox is available only if the Management by class checkbox is cleared.
|
Key mapping - properties grid
| Class (CLAORIMAP) |
|
Displays the child class. You cannot modify this field. |
| Key property (KEYMAP) |
|
Displays the property of the class linked to a key segment. You cannot modify this field. |
| Type (TYPMAP) |
|
Displays the data type corresponding to the property. You cannot modify this field. |
| Parent class (CLAMAP) |
|
Displays the parent class, which is the class from which the link is established. You cannot modify this field. |
| Parent property (PROMAP) |
|
Specifies the parent property used to automatically assign values to child properties during CRUD operations.
This configuration generates propagation rules and an initialization rule (ADDLINE event). |
| Constant value (VALDEFMAP) |
|
Specifies the constant value used to automatically assign values to child properties during CRUD operations.
This configuration generates propagation rules and an initialization rule (ADDLINE event). |
Miscellaneous tab
This tab provides additional information related to access rights. It includes the following elements:
-
Additional properties block: Displays the properties used for data access filtering on data managed by the class.
-
Filters grid: Defines additional filters that can be applied when the class is used to access only a subset of the data.
Additional properties
| Legislation property (LEGSTR) |
|
Identifies a class property where a legislation code can be entered.
This enables the supervisor to automatically filter data accessible in a class instance for a given user. |
| Company property (CPYSTR) |
|
Identifies a class property where a company code is entered. The corresponding database column can be empty or contain the company linked to the data. This allows the supervisor to filter data for CRUD operations based on user rights (for example, read-only access for some companies). |
| Site property (FCYSTR) |
|
Identifies a class property where a site code is entered. It is used to filter data at a more granular level than with the Company property field, with similar access control logic. |
| Access code property (ACCSTR) |
|
Identifies a class property where an access code is entered. Used for more detailed data filtering, similar to Company property and Site property. If empty in the database, the dataset has no access restrictions. |
Filters grid
| Code (OPTCOD) |
|
Unique code for the filter. A selection action is available to select a filter defined for the class. |
| Description (AZOPTLIB) |
|
Displays the description of the filter. |
| Activity code (OPTACT) |
| Specifies the activity code controlling the availability of the filter. |
| Condition (OPTCND) |
|
Defines the filter condition using Sage X3 script syntax (same as Filter instructions). You can only use columns from the main table or directly linked tables (with a 1,1 join). |
| Error message (AZOPTERR) |
|
Specifies the error message displayed to the user if a request does not meet the filtering condition. |
Specific buttons
-
Tree structure
Click this button to open a window that displays the class’s tree structure.
-
Validation
Click this button to validate the class. During validation, the system:
- Checks global consistency of the class description.
- Generates the class code (properties, methods, and operations ) in a C_class.stc script, where class is the class code.
- Generates additional Sage X3 scripts that implement the business logic for CRUD operations and event calls.
Do not modify the generated programs. They are automatically recreated each time the class is validated. -
Copy
Select this button to copy the current record into another folder.
OBJET This fields indicates that you are copying a class. CLES This field displays the code of the class that is being copied. From folder (DOSORG) Select the folder from which the record is copied. The possible syntaxes are described in the dedicated appendix.
All folders (TOUDOS) Select this checkbox to copy the record to all the folders defined in the dictionary (ADOSSIER table of the current solution).
To folder (DOSDES) Define the folder to which the record is copied. The possible syntaxes are described in the dedicated appendix.
Menu bar
-
Options > Global validationValidates all classes in the current folder or context. This ensures consistency across the entire set of classes and regenerates all related scripts if needed.
-
Options > Validation with logPerforms the same validation as the standard Global validation option but also generates a detailed log file. This log helps you review any errors, warnings, or actions taken during the validation process.
-
Options > System property additionAdds system-defined properties to the class. These properties are required for internal processing and integration with Sage X3 features.
-
Options > ReadingDisplays the current class definition in read-only mode. This allows you to review the class structure and properties without making changes.
Error messages
Other than the generic messages, the following error messages can appear when entering data:
Disabled representation
The representation is not valid and cannot be used because errors occurred during its last save.
Non-existent class
The class referenced in the representation does not exist.
Non-existent Table
The table referenced in the representation does not exist.
A technical or system class cannot be used in a representation
The referenced class is a technical or system class and cannot be used in a representation.
Disabled class
The class is inactive. For example, due to an associated activity code set to inactive.
X3 function not authorized
Sage X3 function codes used for triggering a Convergence link are only allowed in desktop representations, not in mobile or tablet representations.
Activity code $1$ associated with group $2$ is not of Sizing type.
Collections can only be sized using a Sizing activity code.
Value 0 impossible for representation classes.
Sizing a collection in a representation with an activity code equal to 0 is forbidden.
Mandatory field
A control is performed on a filter. The field is mandatory.
Impact of class modifications on representations
Changes made to a class can affect:
-
Representations that embed the class
-
Representations linked to a facet of those representations
When a representation is entered in the dictionary, these links can be automatically updated. In such cases:
-
A message displays to inform the user.
-
The user is prompted to save the updated representation.
Additionally, these links are also updated automatically when:
-
A patch is installed
-
The folder is revalidated
Tables used
Refer to the implementation documentation.