A class is the description of a data structure managing an entity (for example a customer, a general ledger entry, a product, a sales order, and so forth).

The Classes function allows users to create and update classes. It feeds dictionary tables and also generates code through a validation function. A class must be validated in order to be used in the code or in a representation. If a class is not valid, an error will be triggered upon execution.

Prerequisites

SEEREFERTTO Refer to documentation Implementation

Screen management

Header

Fields

The following fields are present on this tab :

Unique identifier for the class.

  • Description (field ZINTCLA)

Class description.

Close

 

Tab General

Presentation

This tab displays the class general information.

This tab contains the following grids:

Collections grid

The Collections grid describes all the collections managed in the class. The collection code is assigned in the Properties tab:

    • To simple properties that describe an array of properties. For technical reasons, a child class containing all the properties will be created. The instance of this class will be called COLLECTION.
    • To a child class that describes a collection of child classes.

Scripts grid

The Scripts grid is a list of scripts in which "$METHODS" and "$PROPERTIES" labels are available for the development partners who will add their own code associated with supervisor events (especially for CRUD management).

Close

 

Fields

The following fields are present on this tab :

Management mode

  • Type (field TYPCLA)

 The type defines the conditions of the class use and its behavior.

Persistent

The class is associated with an entity stored in the database. Standard methods such as Create, Read, Updated, Delete (CRUD), and others are available on the class and can be managed by the supervisor layer of Sage X3. This class type manages accessors and methods.

Interface

This class allows to manage CRUD operations manually. It is not linked to the database tables. This class type manages accessors and methods.

Basic

This class type manages accessors and methods, but it is not possible to define mappings. It is often used for child classes of a persistent class.

Technical

The class is associated with an entity in which methods can be defined, but without any accessors. The properties of these classes can not be displayed in a representation.

System

The class describes a data structure. No accessors are generated and no methods can be described. The properties of these classes can not be displayed in a representation.

  • Table - view (field WTABREF)

This field is only used for Persistent classes. It defines the main table on which the CRUD operations are performed. The other tables are defined in the Mapping tab.

  • Index (field WINDREF)

 

  • Keys (field KEYINT)

  • If the class is Persistent: this field displays the key components of the selected index. When several segments are present, the syntax SEGMENT1+SEGMENT2+SEGMENT3 is exactly as the key definition in the table dictionary.
  • If the class is Interface: the key components can be entered with the same syntax if several components exist. The properties used must be properties of the class.

For other types of classes, this field is not populated.

  • field WB

 

  • Transaction management (field FLGTR)

 

Block number 1

Code used to protect the specific classes during the standard patching process if the code starts with X, Y, or Z, or to make the classes optional. It behaves like all activity codes defined in the dictionaries.

If this code is empty or if the activity code is active, the structure is generated.

  • Module (field MODULE)

Technical module to which the representation is associated.

  • In cache (field FLGBUFFER)

If this checkbox is selected, the class describes a hidden class.

  • Searchable (field FLGSEARCH)

If this check box is selected, the data will feed the search engine indexes for the properties that are selected as Searchable. Making a class Searchable is meaningful only if the class is Persistent.

Grid Collections

  • Code (field CODCOL)

Unique collection code of the class.

  • Description (field INTITCOL)

Collection description.

  • Min no. (field MINCOL)

This field defines how the property array is allocated in memory instances. Can be 0, 1, or Maximum.

Activity code If entered, this activity code must be a sizing code. It is used to define the maximum size of the collection, on the basis of the activity code value. The memory allocation process is now dynamic: it is no longer necessary to increase the memory used to store the documents during the processing.

  • Max no. (field MAXCOL)

Maximum size of the collection. The maximum size is mandatory only when the collection is used by properties and not by an instance.

SEEINFOIf you define a maximum number, the number of created elements is limited.

  • Sequence number (field PROCOL)

This field refers to the property of the class that stores the number of lines created in the collection.

  • Insertion (field 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 (field FLGSUPCOL)

If this check box is selected (Deletion = yes), lines can be deleted on the collection. This will be used as the default value on the representation based on the class, but you can change this value (Deletion = no) on the representation. The corresponding method is called ADDELLINE.

  • Sort (field FLGTRICOL)

If this check box is selected (Sort = yes), lines can be sorted on the collection. This will be used as the default value on the representation based on the class, but you can change this value (Sort = no) on the representation. The corresponding method is called ASORT.

  • Addition (field FLGAPDCOL)

If this check box is selected (Add = yes), lines can be added 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 (Add = no) on the representation.  The corresponding method is called AINSERT.

Grid Scripts

  • Type (field TYPTRT)

Standard

Code supplied by the software vendor.

Vertical

Code supplied by the software vendor or a partner, dedicated to the coverage of needs for a given activity sector.

Specific

Code supplied by a partner for a customer or written by a customer's development team to cover dedicated specific needs.

  • Scripts (field CODTRT)

This is the name of the script. The standard naming conventions are as follows: class_Cyyyy, in which:

  • class is the class code,
  • yyyy is STD for the first standard script delivered. If other standard scripts are delivered, they should start with STD.
  • yyyy should start with VER for vertical scripts delivered.
  • yyyy should start with SPE for specific scripts delivered.
  • Running order (field RANTRT)

Order in which the $METHODS and $PROPERTIES labels are called in the event.

Code used to protect the script during the standard patching process if the code starts with X, Y, or Z, or to activate/deactivate the call to the script.

Close

 

Action icon

Processing editor

 

Close

 

Tab Methods

Presentation

This tab defines the additional methods and the operations available on the class. The difference between an operation and a method is as follows:

Operation

An operation can be run in any context and needs an index code and key value to build the context it operates on. An operation can be called through a link in the interface from any existing page when the key values are provided. 

Method

A method works only if a context exists. It will only operate on the current entity instance.

This tab contains the following grids:

Methods grid

The Methods grid lists the methods and operations, and their corresponding information.

Keys grid

The Keys grid lists the key segment parameters associated with the current operation in the previous grid.

Parameters grid

The Parameters grid lists the parameters associated with the current method or operation in the previous grid with their corresponding information.

Close

 

Fields

The following fields are present on this tab :

Grid Methods

  • Code (field CODMET)

This code identifies the name of the method or the operation that can be called on the entity. During execution time, the ACTION variable contains this code when the corresponding event is executed in the "$METHODS" label (in the source files of the associated class) for CURPTH = » ».

  • Description (field INTITMET)

Class description.

  • Return type (field DONMET)

Data type of the value returned by the method or operation. This is the type of the ARET_VALUE variable available in the event associated with the method.

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 (field FLGOPE)

If this box is selected, the line refers to an operation. If not, the line refers to a method.

  • Index (field INDOPE)

This field must be entered only for operations. It identifies the access index to the class instance values by a 'read' operation that must be performed in the operation. It is the default index of the class. This defines the list of key segments requested when a link triggering this operation is set up in a representation.

Grid Keys

  • Code (field CODCLEOPE)

Key segment name.

  • Type (field TYPCLEOPE)

This is the data type of the key segment. It refers to a list of keywords used for the variable declaration. Not all data types are available because they must be recognized in the database segment keys.

  • Description (field INTITCLEOP)

Key segment description.

Grid Parameters

  • Code (field CODPARMET)

Name of the variable that contains the parameter value, as it can be seen in the code called by the "$METHODS" event.

  • Type (field TYPPARMET)

Data type of the parameter sent to the method. It refers to the keyword used for the variable declaration.

  • Description (field INTITPARME)

Variable description.

  • Method (field MODPARMET)

Defines how the parameter is transmitted in the call.

By address

A reference is sent to the call, and any modification made in the call on the variable will directly change the value of the parameter.

By value

A parameter is copied and the value sent can be modified during the call with no impact on the parameter value.

Constant

A reference is sent to the call, but the parameter is read only. Any attempt to modify it during call execution will generate an error.

  • Dim. (field DIMPARMET)

Defines if the parameter sent is an array and what is its first index value. It can be:

No

No array.

From 1

Array with index starting at 1.

From 0

Array with index starting at 0.

Defines the class of the parameter when the Type field has the 'Instance' value.

Close

 

Tab Standard methods

Presentation

This tab describes the availability of the standard CRUD method and other methods supported by the supervisor layer on the class.

Close

 

Fields

The following fields are present on this tab :

Grid

  • Code (field CODMETSTD)

Initial letter of the method (for instance "C" for "Creation" method).

This code is limited to internal use only.

  • Description (field INTITMETST)

Complete name of the method (for instance "Creation").

This allows disabling a method by assigning an activity code. Upon execution, if the activity code is not active, the method will not be available regardless of the next check box value.

  • Y/N (field ENAMETSTD)

If this field is selected (set to Yes), the method is not available and the code is not generated in the class.

Close

 

Tab Properties

Presentation

This tab contains the following grids:

Properties grid

The Properties grid lists the properties of the class.

Keys grid

The Keys grid lists the key segments corresponding to the line selected in the Properties grid (if the property type is linked to a table [version 6 technology] or to a persistent class).

Parameters grid

The Parameters grid lists the parameters of a property, depending on the selected line in the Properties grid, if the type of property has rules requiring additional parameters. Entering a value will then be required to call the rule with the correct parameters based on the context.

Close

 

Fields

The following fields are present on this tab :

Grid Properties

  • Property (field FLDCLA)

Name of the property. This name is used in the Sage X3 script.

If the class is a persistent class, it is strongly recommended to give to the properties the same name as the columns of the database tables used for the data storage. If this is not done, the CRUD operation support will need an additional code to assign class properties with data coming from the database cursor.

  • Order (field NUMFLD)

The init and control methods of the structure are generated in the chronological order of this field.

  • Description (field ZINTFLD)

Property description. This description can be used when designing user interface through representations.

  • Short description (field ZINTSHTFLD)

 

Specify the data type for the field.

As a result of the data type chosen, complementary information could be requested:

  • The parameters of the init and control actions assigned to the data type.
  • The options defined in the object (if the data type is linked to a an object).

If this field is empty, the property must be referenced on the instance of the child class.

  • Menu (field NOLIB)

Number of the local menu if the internal type of the data type in the previous field is "Local menu" ("M").

The numbers define all the available values of the property (for example, 1 is the local menu No / Yes).

  • Length (field LONG)

Is used to specify the field length, if this latter is not specified on the data type and if the data type allows it (absence of format, local menu, etc.)

The field length can be expressed either in a number of characters (for string values), or in a number of digits with this format: N.M, in which 'N' is the number of digits before the decimal position and 'M' the number of decimals.

If this field is not assigned, the field will always be present. If this field corresponds to an inactive activity code, the field will not be generated. Activity codes starting with X, Y, or Z correspond to the specific fields that are not affected by the folder updating.

Code used to protect a specific property in standard classes during the standard patching process when starting with X, Y, or Z. Otherwise, the activity code is the code given during the Sage X3 folder configuration.  It behaves like all activity codes defined in the dictionaries.

Name of the class associated to the property if the property is a class instance. You can enter the name only if the Type field has no value, in this case the class name is mandatory.

  • Collection (field FLDGRP)

Collection code. If there is only one property, this code does not need to be entered. Otherwise, it refers to one of the collections defined in this function. It might then be either an array of children references (header / lines structure) or a denormalized array stored in several columns of a database.

When the data type is a CLOB or BLOB, the Table of the lob and Lob field fields are managed by the supervisor. These fields describe in which table and column the rich media element is stored.

Based on the table used, the Key grid will be filled so that the join can be performed by giving the value of the key.

If the data type is not managed by the supervisor, a program will manage the join and no information can be entered in these two fields.

  • Lob field (field LOBFLD)

 

  • Content type (field LOBCNT)

Displays the content type associated to the data type.

  • Mandat (field OBLIG)

When this field has a Yes value, a "Mandatory field" control is triggered in the field control method.

When this field has a Yes value, a class instance can only be valid if the property is not empty.

The control table can be used to perform an additional consistency control defined through a simple setup.
This is reserved for customization. 
The update of this field does not require protection by activity code.

  • Dependency (field TABCONT)

Defines a property used when the control table depends on another table.

Access code to control the access to the property for a user based on a configuration.

  • Searchable (field FLDSEARCH)

Defines whether the field is used to feed the search index. The field will be indexed only if the Searchable flag is set.

SEEINFOBut deactivating the Searchable flag will not deactivate this information on every line.This allows to deactivate temporarily an indexation without losing the detail of the fields that will be indexed.

A category acts as a filter on the search results.

For instance, if you define a category "SALESREP", you can assign it to the Sales rep field in a customer record. A Sales rep field is also available on the sales order and sales invoices. When you search for "MARTIN", if "MARTIN" is a sales rep present on 20 customer records, 45 sales orders, and 35 sales invoices, selecting only the sales rep category will restrict the search results to these elements, while "MARTIN" might also be present on thousands of other entities.

This category is defined on the miscellaneous table n°16.

  • GET accessor (field FLGACCGET)

If this check box is selected, a 'GET accessor' calling code is generated on the property.

This value can be changed at any time in the dictionary, even in specific standard classes. If the check box is selected, it will not be deactivated by any patch.

SEEINFOActivate this check box only on the properties where it is necessary.Calling 'GET accessors' on every property may create a negative impact on performances during execution time.

Grid Keys

  • Code (field CODCLE)

Column name of each segment key. It is impossible to modify it.

  • Description (field INTCLE)

Description of each key segment. This is not modifiable.

  • Type (field TYPCLE)

Data type of the key segment. This is not modifiable.

  • Value (field VALCLE)

Grid Parameters

  • Code (field CODPAR)

Code for each parameter, displayed automatically. It is impossible to modify it.

  • Description (field INTITPAR)

Description for each parameter, displayed automatically. This is not modifiable.

  • Type (field TYPINTPAR)

Data type of each key segment, displayed automatically. This is not modifiable.

  • Method (field ADRVAL)

The mode defines how the parameter is transmitted in the call. It is impossible to modify it.

By address

A reference is sent to the call, and any modification made in the call on the variable will directly change the value of the parameter.

By value 

A parameter is copied and the value sent can be modified during the call with no impact on the parameter value.

Constant

A reference is sent to the call, but the parameter is read only. Any attempt to modify it during call execution will generate an error.

  • Value (field VALEUR)

Formula that provides the value for a parameter. Some limitations exist on the type of formula that can be used, because the value must be evaluated in the context of the client.

Close

 

Action icon

Column selection

 

Close

 

Tab Mapping

Presentation

This tab defines how the CRUD operations, if they exist, are linked to the database tables for the main instances of the class, and the instances of child classes. You can enter information only if the class is Persistent.

Close

 

Fields

The following fields are present on this tab :

Main table

It identifies the main table from which other tables are read via direct links or through cascade.

This field is filled automatically according to the main table defined in the General tab of this function.

  • Index (field INDREF)

The Index and Description fields are automatically populated according to the index and description defines in the General tab of this function.

  • field AFFIND

 

  • field WA

 

  • Reading (field FLGRREF)

If this check box is selected, the generated program associated with the class will 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 (field FLGCREF)

If this check box is selected, the generated program associated with the class will manage the creation operation. If cleared, the development partner must write the code for reading the data from the main table in the corresponding "AINSERT" event.

  • Modification (field 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 (field FLGDREF)

If this check box is selected, the generated program associated with the class will manage the 'Delete' operation. If cleared, the development partner must write the code for reading the data for the main table in the corresponding "ADELETE" event.

  • Filter (field FLTREF)

This field allows to use a formula that will be used to filter the data. The formula can only include columns from the main table associated to the class.

Grid Table joins

  • Reference (field REFLNK)

Reference of the property of the child class.

Class code associated to the property reference. This field is filled automatically and it cannot be modified.

  • Destination table (field TABLNK)

It identifies the table linked to the table of origin.

  • Abbrev. (field ABRLNK)

It corresponds to the abbreviation under which the linked table is open.

If this field is not populated, the default abbreviation of the table is used. It is particularly useful to enter an abbreviation if the table appears several times in the grid, since several linked lines in the same table need to be on line simultaneously.

  • Origin table (field TABORI)

It identifies the main table at the origin of the link described on the current line. It may be the main table, or one of the linked tables on the previous lines.

  • Abbrev. (field ABRORI)

It corresponds to the abbreviation under which the linked table is open.

If this field is not populated, the default abbreviation of the table is used. It is particularly useful to enter an abbreviation if the table appears several times in the grid, since several linked lines in the same table need to be on line simultaneously.

  • Link type (field TYPLNK)

This type takes on one of the two following values:

  • 1,1 : it means that for each line in the table of origin, only one line in the linked table is read (this line is defined by the key expression).
  • 1,N: in this case, several lines in the linked tables can be read. They are defined by the key expression, that can be incomplete if it is divided into several parts (those lines whose entered key elements correspond to the given value are run through).
  • Main index (field CLELNK)

It defines the table key code used to read the linked lines. By default, the first key of the table is used.

  • Sort index (field CLESORT)

This field defines the initial order of the lines when a "Read" operation is performed on a class instance. If this field is not filled, the main index is used.

  • Join expression (field EXPLNK)

This field is defined as one or more calculated expressions separated by a semi colon. Each expression is evaluated, and the result used to identify the value of the key used to perform the join. When multiple joins are authorized, only the first elements of the key can be given.

In the expressions, constants can be used, as well as fields coming from the tables previously defined in the link list.

  • Selection expression (field EXPSEL)

This selection formula is applied on the table defined in the Linked tablecolumn, and allows to filter that data in the template Caution, these conditions are not applied for the indexation process. The syntax is the script syntax of Sage X3 used in the Filter instructions.

Activity code used to protect the modified or specific lines in the grid or to disable some lines if the associated activity code is set to inactive.

  • Class management (field FLGA)

If this check box is selected, the supervisor layer will implement the CRUD operation by calling the method implemented in the class defined on the line. If this check box is cleared, the CRUD operations support will be embedded in the code of the main class when the corresponding check boxes are selected.

  • Del/ins management (field FLGV)

If this check box is selected, any update on the lines will be performed by deleting and inserting all the lines, rather than only the modified lines. Selecting this check box affects the performances, but it might be necessary if the key of the line records changes every time lines are updated or inserted (for example, if the line number is reassigned).

  • Reading (field FLGR)

If this check box is selected, the generated program associated with the class will 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.

SEEINFOThis check box can be accessed only if the Management by class check box is cleared.

  • Creation (field FLGC)

If this check box is selected, the generated program associated with the main class will manage the creation operation on the corresponding child class. If cleared, the development partner must write the code for reading the data from the main table in the corresponding "AINSERT" event.

SEEINFOThis check box can be accessed only if the Management by class check box is cleared.

  • Modification (field FLGU)

If this check box is selected, the generated program associated with the main class will manage the 'Update' operation on the corresponding child class. If cleared, the development partner must write the code for reading the data from the main table in the corresponding "AUPDATE" event.

SEEINFOThis check box can be accessed only if the Management by class check box is cleared.

  • Deletion (field FLGD)

If this check box is selected, the generated program associated with the main class will manage the 'Delete' operation on the corresponding child class. If cleared, the development partner must write the code for reading the data for the main table in the corresponding "ADELETE" event.

SEEINFOThis check box can be accessed only if the Management by class check box is cleared.

Grid Key mapping - properties

Displays the child class. It is impossible to modify it.

  • Key property (field KEYMAP)

Displays the property of the class linked to a key segment. This is not modifiable.

  • Type (field TYPMAP)

Displays the data type corresponding to the property. This is not modifiable.

Displays the parent class, that is the class from which the link is established. It is impossible to modify it.

  • Parent property (field PROMAP)

The last two fields of the grid, Parent property and Constant value, are used to define values that have to be assigned automatically to the children properties during the CRUD operation. This will automatically generate the corresponding propagation rules, and an initialization rule ("ADDLINE" event). A value can be defined as:

  • a parent property, used to assign the child value, or
  • a constant value.

SEEINFONote that only one of these two fields can be filled.If none is filled, no automatic assignment will be done.This is usually the case with the last key element.

  • Constant value (field VALDEFMAP)

 

Close

 

Tab Miscellaneous

Presentation

This tab defines additional information dedicated to access rights.

This tab contains the following grids:

Properties grid

The Dedicated properties grid displays the properties used for data access filtering on data managed by the class.

Filters grid

The Filters grid defines additional filters that can be selected when the class is used to access only a sub-set of the data managed by the class.

History grid

The History grid contains information to ensure compatibility with the version 6 code for data access restrictions.

Close

 

Fields

The following fields are present on this tab :

Additional properties

  • Legislation property (field LEGSTR)

If the field contains a value, it identifies a property of the class where a legislation code can be entered. In the database, the corresponding column can either:

  • be empty: the record can be accessed by anyone,
  • contain a legislation code: the user must have the right to access the corresponding legislation.

This enables the supervisor to perform an automatic filtering on the data set accessible in a class instance for a given user.

  • Company property (field CPYSTR)

If the field contains a value, it identifies a property of the class on which a company code is entered. In the database, the corresponding column can be empty or contain the legislation company to which the data are linked.

This enables the supervisor to perform an automatic filtering on the data set accessible in a class instance for a user, for a CRUD operation, depending on their rights (with some companies, the user may have a read access but not a write access).

  • Site property (field FCYSTR)

Field of the structure defining the site to manage the functional authorizations.

If the field contains a value, it identifies a property of the class on which a site code is entered. It is used to filter data in a more detailed way than with a company, but with the same possibilities.

  • Access code property (field ACCSTR)

Field of the structure to manage the access rights.

If the field contains a value, it identifies a property of the class on which an access code is entered. It is used to filter data in a more detailed way than with a company, but with the same possibilities. The major difference is that the access code can be empty in the database. In that case, the data set has no access restrictions.

Grid Filters

  • Code (field OPTCOD)

Unique code for the filter. A selection action is available on this field to select a filter defined for the class.

  • Description (field AZOPTLIB)

Filter description.

 

  • Condition (field OPTCND)

Filter condition expressed in the Sage X3 script language (same syntax as used in the Filter instructions). Only columns present in the main table or in tables that are directly linked to the main table with a join (1,1) may be used.

  • Error message (field AZOPTERR)

Error message that will be sent to the user if a request is made on an instance that does not fulfill the filtering condition.

Close

 

Specific buttons

This button can be used to show a window displaying the tree structure of the class.

This button performs the validation of the class, which also:

  • Checks the global consistency of the class description.
  • Generates the code of the class (properties, methods and operations ) in a "C_class.stc" script, where class is the code of the class.
  • Generates the code of additional Sage X3 scripts where the business logic associated with the CRUD operation supports as well as the event calls are coded.

SEEWARNINGThe generated program must not be modified as it will be automatically recreated during validation.

Menu Bar

Options / Global validation

Options / Validation with log

Options / System property addition

Options / Test

Error messages

In addition to the generic error messages, the following messages can appear during the entry :

Disabled representation

The representation is not valid and cannot therefore be used, because other errors occurred when the representation was saved.

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 class referenced by the representation cannot be used.

Disabled class

The class is not active (for instance because there is an activity code on it that has been set to inactive).

X3 function not authorized

X3 functions code used for triggering a Convergence link: can only be present on Desktop representations and not on Mobile and Pad representations.

Activity code $1$ associated with Group $2$ is not of Sizing type.

The activity code used to size collections must be 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.

Additional information

Note that the modifications on the class can have an impact not only on the representations embedding the class, but also on the representations that have a link on a facet of these representations. The entry of a representation in the dictionary can thus trigger an automatic update of the links. In that case, a message is displayed and the user is invited to save the updated representation. The link on the representations is also automatically done when a patch is installed or the folder is revalidated.

Tables used

SEEREFERTTO Refer to documentation Implementation