Tables
Use this function to create and modify database tables by defining their characteristics in the folder’s data dictionary. Once the definition is confirmed, the system creates or updates the corresponding table in the database.
Table management defines the list of database tables. You can also use activity codes to deactivate certain tables or indexes.
In addition to the structure of the table, the dictionary also defines:
- Links to other tables (referential integrity). These links are used by cancellation utilities, import/export functions, and related tools.
- Default information proposed when creating screens from these tables, such as help keywords, formatting, and so on.
Each table is identified by a name, in uppercase alphanumeric characters and starting with a letter, and an abbreviation. Custom or localized tables need to begin with X, Y, or Z.
Both the name and the abbreviation need to be unique within the database.
A table can be managed through an object, provided the necessary screens have been created.
Prerequisites
Refer to the implementation documentation.
Screen management
A table definition is defined in five tabs:
Header
This tab defines basic identification information.
The following fields are present on this tab:
| Table code (CODFIC) |
|
The table code consists of 1 to 10 alphanumeric characters. It needs to start with a letter. It is the unique identifier for tables in the data dictionary. Adonix reserved words are prohibited. |
| Abbreviation (ABRFIC) |
|
The table abbreviation consists of 1 to 3 alphanumeric characters. It needs to start with a letter. It is the unique identifier for table abbreviations in the data dictionary. Adonix reserved words are prohibited. |
| Description (ZINTITFIC) |
| Table description. |
General tab
This tab defines general information regarding table behavior and system management.
The following fields are present on this tab:
Characteristics
| Activity code (CODACT) |
|
The activity code and module determine whether the table must be created in the folder’s database. A table is created only if:
Tables associated with activity codes starting with X, Y, or Z are considered specific or custom and are not affected by version changes. You can place these activity codes at line level. |
| Module (MODULE) |
|
Defines the module to which the table belongs. Module dependencies include:
|
Table management
| Database type (TYPDBA) |
|
Defines the target database where the table will be generated. Folder indicates that tables are created using the folder’s database type. Some exceptional cases, such as external tables, can require additional parameters. |
| Compatible with previous version (FLG130) |
|
Select this checkbox if a v130 folder needs to access a v140 table. This forces the table structure to comply with v130 limitations (no CLOB or BLOB types). Note - informationAccessing v130 tables from v140 folders does not require special actions.
|
| Number of records (NBENREG) |
|
Indicates the expected table size. Used for initial sizing during folder creation. Values are calculated using the sizing formula and folder-defined variables. During folder revalidation, the number of records is recalculated and updated only if the new value is bigger. You can manually increase this value, but decreasing it persists only until the next revalidation. Oversizing is preferred for performance and safety reasons. It is not necessary to protect the modification of this field with an activity code. |
| Generate translated text (GENTRA) |
|
This checkbox determines how translated texts are handled in Crystal Reports:
New texts to translate should use the view method to avoid overloading sequential files. This parameterization field does not require an activity code to protect it. It needs to be consistent with the technique used in the Crystal report linked to the table. |
| Reset to zero (ZERO) |
|
This checkbox is used by the return to zero utility, which resets data in a folder. The utility protects fixed master data (such as products, business partners, accounts, and BOMs) while deleting all transactional data (such as movements, documents, invoices, stock transactions, or work orders). This is typically used after test scenarios or trial start-ups. When this checkbox is selected, the return to zero utility deletes all rows in the associated table. One of these flags is found in each field, when a field must be reset to zero without the table being emptied. Use this option when you want a clean slate for movements while preserving master data. |
| Open access (SECURE) |
|
This checkbox controls whether access to the table’s data is restricted within the folder owning the table and certain authorized folders. The same logic also applies to views. Changing this setting requires revalidating the table, so the database configuration can be updated.
When the table is secured, access is authorized for:
This checkbox is not updated by patches, since table security is treated as a configuration parameter. When the table is validated and this checkbox is selected, the system generates a .cfg configuration file containing: Copy
If other manual directives already exist in the configuration file, they are preserved. You can also add additional directives manually from the Tables function (GESATB), under the Configuration file section in the Index tab. |
Folder management
Specific columns
Columns tab
Use this tab to define all the fields of the table through a drop-down menu.
In each table, it is possible to use fields whose names are standardized and which will automatically be updated by object management, if they exist. The fields are the following:
- CREDAT and UPDDAT are respectively the creation and last update dates.
- CRETIM and UPDTIM are respectively the creation and last update times.
- CREUSR and UPDUSR are the user codes that performed the record creation and its last update.
- EXPNUM is a sequential number used to timestamp the records for the import/export module, making it possible to export only the records that have been updated since the last export.
- You can also add a sixth field to any table. This field, called ENAFLG, represents an active/inactive flag. If the table is managed by an object and a data type is associated with this field, the following controls are applied:
- The standard selection window for the object, called by the selection key, automatically filters out inactive records.
- An error message prevents direct entry of an inactive key code.
This does not apply when managing the object itself, as otherwise it would be impossible to reactivate records that were temporarily marked as inactive.
The following fields are present on this tab:
Grid
| Line number (NUMLI) |
| The current line of the grid. |
| Column (CODZONE) |
|
Define the field name for the table as it will display in the software. A field with the name FIELDNAME defined in an ABV abbreviation table can be accessed using the [F:ABV]FIELDNAME syntax. For custom or specific fields, the field name must start with X_, Y_, or Z_. In the database, each zone corresponds to one or more fields, according to whether the zone is sized. The corresponding fields are named FIELDNAME_0, FIELDNAME_1, and FIELDNAME_2. To enter and display the corresponding field on a screen, it is assigned the same name in the screen dictionary. The screen and the table are used simultaneously in object management. |
| Type (CODTYP) |
|
The field type is defined here, which characterizes the entry format (numeric, alphanumeric, date, and so on) and the consistency controls (for example, reference to a table). The main generic types are:
However, many other predefined types exist. They often reference an auxiliary table (currency, country, and so on). A dedicated dictionary is used to describe them. You can select them using the F12 key, which displays the list. |
| Menu (NOLIB) |
|
Defines the local menu number associated with the field defined on the line. When a field is of the local menu type (from 1 to 255), it corresponds to the position of a title in a table called local menu, stored in the APLSTD messages table. On entry or on display, the following appear depending on the user interface settings:
The advantage of this type of entry is that the list of choices is displayed in the user's connection language. Each local menu number defines the list of available titles. For example, local menu 1 corresponds to the No/Yes choice in this order. In this particular case, the user interface can also display a checkbox. |
| Length (LONG) |
|
Used to define the length of a field when this field uses a generic data type for which the length is not fixed. This is particularly the case for A and DCB types. |
| Activity (CODACT) |
|
An activity code is used to:
If the activity code is disabled:
|
| Dimension (DIME) |
|
Dimension of the field in the table. You can also assign the dimension based on the activity code. |
| Normal title (INTITCOURT) |
|
Title for the field over three lengths: short title being limited to 12 characters, normal title at 20 characters and the long title at 35 characters. These titles are translatable texts and they are stored in a dedicated table, ATEXTE. When a new text is entered, after creation of a section, a window appears whose title is Text. There is then a choice between the following three options:
When in modification mode for a text already entered there is also an additional choice of displaying in the window, where the title is presented Text nnn (nnn being its number). It is then possible to modify the text whose number is given, to conform with the text that is being entered (this modification is made wherever the corresponding text is used, once the corresponding screens have been revalidated). In addition, it is possible to call, using the right button on the mouse, the Abbreviation function that is used to select one of the standardized abbreviations defined when a title is too long (the use of abbreviations must be avoided as far as possible to facilitate the readability of the screens). |
| Abbreviated title (INTITABREG) |
|
Title for the field over three lengths: short title being limited to 12 characters, normal title at 20 characters and the long title at 35 characters. These titles are translatable texts and they are stored in a dedicated table, ATEXTE. When a new text is entered, after creation of a section, a window appears whose title is Text. There is then a choice between the following three options:
When in modification mode for a text already entered there is also an additional choice of displaying in the window, where the title is presented Text nnn (nnn being its number). It is then possible to modify the text whose number is given, to conform with the text that is being entered (this modification is made wherever the corresponding text is used, once the corresponding screens have been revalidated). In addition, it is possible to call, using the right button on the mouse, the Abbreviation function that is used to select one of the standardized abbreviations defined when a title is too long (the use of abbreviations must be avoided as far as possible to facilitate the readability of the screens). |
| Long title (INTITLONG) |
|
Title for the field in three lengths. The short title is limited to 12 characters, the normal title to 20 characters, and the long title to 35 characters. These titles are translatable texts and are stored in a dedicated table, ATEXTE. When a new text is entered, after creating a section, a window titled Text displays. You then have the following three options:
When modifying an already existing text, there is an option displayed in the window, where the title appears as Text nnn (with nnn being its number). It is then possible to modify the text corresponding to that number so that it matches the newly entered text. This change is applied wherever the corresponding text is used, once the relevant screens have been revalidated. In addition, by right-clicking, it is possible to call the Abbreviation function, which lets you select one of the standardized abbreviations defined when a title is too long. Avoid using abbreviations whenever possible to maintain screen readability. |
| Property name (API) (APROPNAM) |
| This field displays the name of the property as defined in the data model. |
| Denormalized collection (API) (DENCOLGR) |
| This field indicates the name of the denormalized collection linked to this property. |
| Package name (API) (APACKNAM) |
| Select the API package to which the node belongs. |
| Options (OPTION) |
|
These options are represented by characters that can be concatenated when several options are required. You can select these options through a selection window. A detailed description for all possible options is available. |
| Linked table (field LIEN) |
|
Code for a table linked to the one being modified through the current field. For the data types that reference an object, this field is assigned automatically. |
| Link expression (EXPLIEN) |
|
This field is entered only if a linked table has been specified. If this field is not assigned, the link is made directly from the field on the current line (which assumes that the primary linked table key is not the only component). If the primary key contains several components, the link expression must be written in the form: comp1;comp2;comp;..., where comp1,comp2, comp3,... are the components of the key.
|
| Global variable initialization (API) (VARVALUE) |
|
Defines the initial value assigned to a global variable when it is used in a link expression or API context. This ensures the global variable has a valid default value when the table is accessed. |
| Copy legislation (CHPLEG) |
|
This field is linked to the Copy legislation checkbox. It specifies the field that contains the legislation, or the field that links to the master table containing the legislation. |
| Cancellation (ANNUL) |
|
During the cancellation of a line in the linked table (source table), a specific action can be applied to the table currently being modified or created (destination table). This action is defined by the following codes:
|
| Verification (VERIF) |
|
This field is used to indicate whether the coherence verification utility must check the link. |
| Mandatory (OBLIG) |
|
You can define whether the field can be empty or whether it needs to contain a value (not empty). An empty field can be:
When the field is a key in a table, if the cancellation control is set to RTZ, the link cannot be mandatory because the cancellation can clear the key field. In this case, the Mandatory field is automatically set to No. |
| RTZ (ZERO) |
|
Indicates whether the field is affected by the Return to zero (RTZ) process. When enabled, the field is reset to zero during the RTZ processing applied to the table. If RTZ is active for the field and the field is part of a key, the field cannot be mandatory, since the reset operation can clear its value. |
Index tab
Use this tab to define the different indexes created for the table.
The following fields are present on this tab:
Index grid
| Line number (NUMLIG) |
| The current line of the grid. |
| Index code (CODIND) |
|
This field corresponds to the name under which the index is known in the database. A standard naming convention is used in all application tables. Keys are named using the table abbreviation followed by 0 for the primary key, 1 for the secondary key, and so on. For the specific or custom indexes, this code must begin with one of the following letters: X, Y or Z. |
| Index descriptor (DESCRIPT) |
|
Enter here the list of fields that make up the index. The fields are separated by a + if the index contains multiple fields. For example, in the FACILITY sites table, there is a key defined as LEGCPY+FCY. A descending sort field is preceded by the - sign. This is used in the left list. The first field in the index is written without a sign and is therefore considered ascending. |
| Duplicates (HOMONYM) |
|
Define whether the key can or cannot accept duplicate values (homonyms). |
| Default clustered index (DEFORDIND) |
|
Use this column to define a default clustered index provided by Sage. If you select No, a default clustered index is not defined. If you select Yes, this is the clustered index used. To change the clustered index, you need to define a Specific cluster index or select the Clustered index disabled checkbox to prevent the use of any clustered index. This value can be modified by patch. This default setting does not apply if you already set up a clustered index locally in the configuration file or in the Specific clustered index field. |
| Specific clustered index (ORDIND) |
|
Select Yes to define this index as the clustered index. Only one index can be selected per table. A clustered index is a specific type of index that determines the physical order in which records are physically stored in the table. This is a special setting that can never be modified by patch. |
| Activity (CODACT) |
|
If this field is not assigned, the index will always be present. If this field corresponds to an inactive activity code, the index will not be generated. It is possible to add a specific or custom key using an activity code that begins with X, Y or Z. |
| Default clustered index disabled (ORDINDSTA) |
|
Use this column to disable the clustered indexes for the table. The clustered index delivered by Sage in the Default clustered index column is disabled, even if you have not defined a clustered index in the field dedicated to this setup. Select this checkbox to disable the clustered index. |
Configuration file
| FICCFG |
|
A text describing the technical configuration of the table in the database is entered in this section. This text is recorded in a file named name.cfg in the FIL directory of the application. This file is used by the valfil instruction. Refer to the dedicated technical annex for more information. |
Audit tab
Use this tab to configure the settings that allow insertions, deletions, and modifications performed on a table to be logged using automatically generated database triggers. When required, the values before and after the modification can be stored in dedicated fields.
Any record modification is logged as long as at least one of the field conditions is met.
This trace is stored in two specific tables: AUDITH and AUDITL. It can be viewed directly or can generate automated notifications through the Workflow.
The main principle is as follows:
-
As long as at least one audit flag (creation, modification, deletion) is selected, each operation of that type creates a line in the AUDITH table. This occurs regardless of whether field values are logged or whether their corresponding modification conditions are met.
-
As soon as fields are listed in the field grid, any modification to a field value that meets the specified condition triggers the creation of a line in AUDITL.
The trigger method makes it possible to log operations even when they are performed by a program other than Adonix.
The information in this tab is applied when the table is revalidated. Triggers are automatically created or modified at the same time.
The SUBTRIGGER processing contains the trigger description depending on the database.
The SPETRIGGER processing is used for specific developments to customize the trigger description.
The information in this tab is considered part of the setup. The standard does not deliver any audit setup. It is not necessary to protect modifications made in this tab using activity codes X, Y, or Z.
Audit behavior is globally controlled by the AUDIT activity code.
Following cannot be audited:
- The audit tables themselves
- fields of CLOB and BLOB type
- Fields whose data type is AXX
The results of the audit can be viewed using following functions:
The following fields are present on this tab:
Type of audit
These three checkboxes are used to define which operations on the table’s records must be logged:
- Creation
- Modification
- Deletion
Functions
Tracking key
Fields audited grid
| All the fields |
|
Select this action in the Audit tab to load the grid with every field defined in the table. |
Limits to be respected
There are several constraints to consider when creating a table. The limits are as follows:
Concerning the key
- Maximum of 15 indexes
- Maximum of 16 fields per index
- Maximum of 250 characters per index
Concerning the record
- Maximum size of 32 KB under Oracle and SQL Server
- Maximum of 255 fields per table
- Maximum of 1,000 columns (calculated as field1 × dimension1 + field2 × dimension2 + … + fieldN × dimensionN)
- Limit of either:
- one BLOB or CLOB field of any size, or
- several BLOB or CLOB fields, provided the total table size does not exceed 64 KB.
Number of open tables
- Maximum of 255 open tables
Reports
By default, the following reports are associated with this function:
- DICOX3: Table dictionary
- ATABLIST: List of tables
This can be modified using a different setup.
Specific buttons
-
Validation
Select this button to create or update the table in the database based on its definition in the dictionary.
If the table does not exist, it is created empty.
If it already exists, its structure is updated according to the new definition in the dictionary. New fields are added, deleted fields are removed, and fields whose structure or dimension has changed are recopied. The existing records are preserved.
It is also possible to force the validation, which performs a complete revalidation of the data and indexes.
If this option is not selected and the table structure has not changed, only the indexes are rebuilt.
It can also be useful to assign default values to fields for existing records. This can be done using the Processing button.
-
Processing
Select this button to create a temporary processing routine named WWINIXXX, where XXX is the table abbreviation. This processing is executed after the table validation, if the table already exists, and allows default values to be assigned to fields in existing records.
A default processing template is proposed when this button is used, and additional instructions can be added as required.
The processing consists of the following three labels:
-
$OUVRE: Executed at the beginning, before the update transaction starts. It must at least open the table being validated.
-
$DEFAULT: Executed after the transaction begins but before reading the first record. At least one Default File instruction must be inserted so that the default table is correctly set to the table being updated.
-
$INIZON: Executed once for each record, just before the record is rewritten. This is where the assignment instructions for the fields need to be written.
Example
If a MYFIELD numeric field is added to a table and needs to take the value of an existing OTHFIELD field increased by 1, the following line has to be placed in the $INIZON section:
CopyMYFIELD = OTHFIELD + 1Note - warningThis processing behaves differently from older Adonix versions such as those used in Adonix Enterprise versions 2 and 3. The processing is executed only after the structure modification phase is complete.
Because of this, if a field XXX is renamed to YYY, you need to perform the change in three steps:
- Keep both fields in the database.
- Add the assignment YYY = XXX in the initialization processing.
- After validation, delete the XXX field.
If this is attempted in a single step, the processing will fail and produce an error because field XXX no longer exists at execution time, and its value can be lost.
-
-
Copy
Select this button to copy the table structure to another folder.
Note - warningOnly the table description in the dictionary is copied. The table itself is not created in the target folder. You need to validate the table in that folder for it to be created. The table’s data is not copied either.
Note - informationThe NBENREG field (number of records) and all fields from the Audit tab are not copied.
-
Clear
Select this button to delete all data in the table.
For performance reasons, the table is deleted and then recreated empty.
A confirmation is required, as this operation is irreversible.
-
Delete
Select this button to delete both the record in the dictionary and the table in the database, similar to a DROP TABLE operation.
Two confirmation messages display one after the other, because it is possible to delete only the physical table without deleting the dictionary data.
Menu bar
| Options/Information |
|
Displays an information box showing:
|
| Options/Source |
|
Displays the .srf file corresponding to the current table in the current application. This option is useful on a server where the FIL directory is not accessible. |
| Options/Maintenance |
| Opens the maintenance function directly for this table. |
| Documentation/Paragraphs |
|
Opens documentation management for the first documentation paragraph (if one exists) associated with the current record. |
| Documentation/Links |
|
Opens link management for documentation. This is used to define documentation‑specific relationships between the current record and other records (for example, the links between functions and parameters). These links are used during the generation of documentation structures. |
| Documentation/Generation |
|
Starts the documentation generation process. You can also launch this action using the Generation button at the bottom of the screen. You can generate one or all of the following simultaneously:
The range suggested by default takes into account the current record, but you can modify it at launch time. |
Error messages
In addition to the generic error messages, the following messages can appear during the entry:
| The table contains no fields |
| A table has been created without defining at least one field. |
| The table does not contain a primary key |
| At least one index is required for every table. |
| The field title is not referenced |
| The title field entered in the first tab does not exist in the list of fields defined in the second tab. |
| Abbreviation exists already |
|
Abbreviations must be unique in the folder. This message appears when attempting to create a table using an abbreviation already used by another table. A warning also appears if an existing table tries to use an abbreviation already defined for a view. Unique abbreviations are recommended. |
| Prohibited character |
| The character " is not allowed in titles. |
| The field title is not referenced |
| A title entered in the General tab references a field not defined in the Fields tab. |
| Local menu number incorrect |
| This local menu number does not exist. |
| Incorrect length |
|
The field length is incompatible with its internal type. Allowed length rules:
The length value can also be incorrect if it is empty. |
| Incorrect option |
| You tried to enter an option that does not exist in the Option column associated with a field in the table. |
| Incorrect link expression |
| The link expression has a syntax error. |
| Index already entered |
| You tried to define the same index twice in a table. |
| Non-existent field |
| An index references a field that does not exist in the field list. |
| Dimensioned field |
| You tried to use a dimensioned field in an index, which is prohibited. |
| Number of columns too great |
| The table exceeds the limit of 1,000 columns, after applying dimensions. |
| Too many fields |
| The table exceeds the maximum of 255 fields. Dimensions do not count here. |
| Line length too great |
|
The record size exceeds the allowed database limits:
|
| Key too long |
| An index exceeds the maximum size of 256 characters. |
| Too many components in the key |
| A key contains more than 16 fields, which is the limit. |
| There are no translatable texts in this table |
| The Generation of translatable texts checkbox is selected, but the main table does not contain any field of AXX, AX1, AX2, or AX3 type. |
| Caution: This modification makes it necessary to change the Crystal reports linked to this table |
| Changing the Generation of translatable texts setting modifies how translated texts are printed in Crystal Reports. You need to update any reports using this table accordingly. Avoid modifying this option. |
| Other errors likely to appear |
|
Additional errors can occur during table validation. They are displayed in a log file. Examples include:
|
Tables used
Refer to the implementation documentation.