Refer to documentation Implementation
The Structures function comprises a single tab subdivided into key elements of the sequence code.
Presentation
Each block represents a key element that you must define for your sequence code. The Components block, however, is variable. You use this block to define the components that make up the structure of the sequence number for your organization.
Close
Fields
The following fields are present on this tab :
Block number 1
| This code identifies a counter which is referenced when generating an automatic number for a document. A counter is an alphanumeric field of between 1 and 20 characters. It comprises a series of components which are concatenated from left to right to form the counter value. |
| Enter the description of the relevant record. This long description is used as a title in screens and reports. |
Definition
| Use this radio button to define if this sequence number series is available for the whole folder, for a single company or for a single site. To avoid duplication of numbers Sage suggests that you use comments appropriate to the counter in the code or the description. This is especially important for company and site sequence numbers. |
| reserved for GEODE. |
| Use this radio button to determine if there is a unique value in the counter at a particular time, or by month or by year, financial year or accounting period. To avoid duplication, this assumes that the appropriate components are defined in the counter, specifically for the year, the month, the week or the day. This field combined with the Definition level field with the use of an additional field code (see Additional field) defines how many numbering sequences will be assigned to the sequence number counter (this will be a unique sequence for a sequence by month, by site and by additional value). As a function of these two values, it is possible to introduce components to avoid duplication of numbers. In this way for example, if an annual RTZ level is defined, the year must be a component of the sequence number series. Similarly, if the sequence number series is defined by company, the site or company must be a component of the sequence number series. |
| A counter always produces alphanumeric keys. If you define the Type as Numeric the leading zeros are deleted when the value is returned. A counter that has been declared as numeric with 6 numbers will therefore start with the value "1", whilst an alphanumeric counter with 6 characters will start with the value "000001". If the counter is defined as numeric and alphanumeric components are declared in the structure of the counter, no control will be carried out at the creation. When utilized, only the numeric part of the counter will be returned. |
Grid Component
|   |
| Define each type of component that is to be used to make up the structure of the sequence number counter. |
| Each component has a predetermined or maximum length, as follows:
|
| Type in a fixed character string. You can type in any alphanumeric characters including special characters such as / and %. Do not use single or double quotes around the value. |
Block number 4
| Sage recommends you set this radio button to Normal. For a detailed explanation of this field see Sequence types. |
| This field is populated when the Sequence type is set to Database sequence. It displays the name of the table associated with the numbers. |
| This field is populated when the Sequence type is set to Grouped. It displays how many numbers will be assigned simultaneously. |
Miscellaneous
| Select this check box to activate chronological control for documents where current legislation requires numbers by date to be in chronological order. This is a requirement for some legislations such Italy. Chronological control is only activated when an invoice is created in the Sales, Purchasing and AP-AR accounting modules. |
| This field displays the maximum permitted length of this sequence number counter. |
| Select this check box to set the sequence number start value to zero. The first generated sequence number will start at 1. |
|   |
Close
Component type | Explanation |
Constant | Fixed character string. The value must be entered in the Formula column. Do not use single or double quotes around the value. |
Year | Length = 1 represents the last number of the year (0 - 9). |
Month | Length = 2 represents the month as a number (00 - 12). |
Week | Length = 2 represents the week number (00 to 53). |
Day | Length = 1 represents the day in the week as a number (1 - 7). |
Company | Company code to which the transaction is assigned (in one to five characters). |
Site | Site code to which the transaction is assigned (three characters). |
Sequence number | Incremental part of the sequence number structure. This value increments by 1. The initial value is 1. |
Complement | Additional component. The value depends on the module that is using the sequence number component. |
Fiscal year | The fiscal year number is defined using one to three digits (for the first open fiscal year the value is equal to 1). The value of this component is evident where there are offset fiscal years. When this situation occurs there is a break in the number when the year changes. This can occur in the middle of a fiscal year. |
Period | The period number is represented by one to three digits (starting with 1, up to the maximum number of periods in a fiscal year). |
Formula | Used to insert a formula into the sequence number structure. This is essentially an independent series of characters inserted into the generated sequence number. The formula can be alphanumeric, a number or a date, and up to a maximum of 20 characters. Note that alphanumeric characters are converted to uppercase and then formatted to the exact number of planned characters. |
The additional field code is used to define a sequence number segment depending on the context, without having to define two sequence number counters. It is important to understand that in this situation there is a chronological sequence for each different value stored by the additional field code.
Using the additional field code depends on the context used for each function.
For the Supervisor functions the additional field code can be used for the sequence number counter of the lot numbers in the import-export temporary storage space. It contains the code of the import-export template being used.
A list of the additional field codes used in the business modules is defined in the attached documentation.
In all other cases, the additional field number is not assigned. You can however use a dedicated entry point to give a specific value to the additional field number in a given context.
You can integrate the additional field code in a numbering sequence without using a different sequence by counter value. In order to achieve this you must include the Formula component type with the formula [L]ADDITIONAL FIELD (ADDITIONAL FIELD) as the local variable known to the number sequence subprogram that stores the current value of the additional field.
The Sequence type can be important for customer installations with a large number of workstations that create a large number of a given type of document. According to the sequence type that is used there can be transactional conflicts linked to obtaining numbers from the sequence number counters.
The allocation of the number, usually when creating a document (order, posting, invoice, etc.), is carried out in the creation transaction itself. This means that the number will not be lost in the event a transaction is cancelled by a rollback. As long as the creation transaction (which can last several seconds) is not completed all concurrent creation transactions will fail for the same type of document as they cannot obtain a number. A rollback of the concurrent transaction will be carried out followed by a new attempt (that starts if the first transaction is completed).
The number of successive attempts carried out as a result of this type of lock before cancellation of the transaction on error can be set up using the ROLLBACK definition from the SUP chapter. Should a conflict occur the value of this definition can be increased. You must be aware, however, that consumption of data server resources can increase to the detriment of performance. You can adjust the sequence type to improve this.
Conversely, the normal sequence number counter guarantees the respect of sequential order in time: Two successive calls in time to a given sequence number counter will provide incremental numbers, all conditions linked to the structure of the sequence number counter (company, site, period, supplement) being equal. In addition, no number loss relative to the lock can occur. This type of sequence number counter is therefore recommended for legal documents for which strict sequences with no number sequence "gaps" are demanded.
The numbers are allocated using a group of N numbers (where N is a definition). Contention is therefore less important because only an assignment to N can cause a contention with the other assignments using an available number.
Conversely, the sequential assignment of numbers is not guaranteed, and a loss of numbers is possible for the sequence number counter depending on the month or the period. For example, where N is equal to 10, the number 1 to 8 is already assigned and 3 creation transactions are in process. The first will be assigned to the number 9, the second to number 10, the third cannot find an available number in the first group of 10 numbers. The range 11 to 20 will then be created which will lead to the first available number being assigned as 11. If in the meantime the first transaction fails for other reasons, the number 9 will become available for a new transaction. If no further transaction is started the situation arises where all the numbers between 1 and 11, excluding 9 are used, and where the next numbers to be assigned will be (in order) 9, then 12 etc. Therefore there is not a strict adherence to the number sequence. If no other document creation takes place during a day, and if a document is created the next day, there will be a document dated for day D numbered 11 and a document dated for D+1 numbered 9. Finally, if the sequence number counters contain the number of the month and this situation occurs at the end of the month, there will be a gap in the number sequence (but it is possible to trace this as the number is found in the list of numbers to be assigned).
The number assignment is made outside of the transaction, that is, there is no contention, but no backward return is possible (if the number is not used it is permanently lost). This type of sequence number counter relies on the database sequence. Safe X3 creates, for each table in the database, a sequence that is normally associated with it to obtain a technical number. It is important to note that this numbering is never reset to 0 (therefore you must plan for a large number of digits associated with the numbering sequence in the serial number sequence). It is also strictly sequential (the order of assigned numbers always increases), however it is possible to have gaps in the sequence without either justifying or recovering them. This characteristic is used from the moment there is a need for a unique technical number, for which no justification for gaps in the sequence is necessary.
The advantages and drawbacks of the different types of sequence number counters are summarized in the following table:
Type of sequence number counter | Increasing sequence | Number loss | Multi-user conflicts |
Normal | Always | Never | Strong |
Grouped | Not always | At the end of the period, but justifiable (list of lost numbers) | Average (more reliable when N is large) |
Database sequence | Always | Yes, without justification | Nil |
Click the Copyaction to copy this sequence code and structure to a different folder. |
In addition to the generic error messages, the following messages can appear during the entry :
An attempt has been made to define a sequence number series with two components of the type Sequence number (a single sequence number is authorized by the sequence number series).
The length requested is not compatible with the definition (for example, a year with 8 digits or a month with 5 characters).
The total length of the sequence number series exceeds 20 characters, or the sum of the lengths of the components is different to the total permitted length.
The calculation formula that has been entered has an incorrect syntax.
A counter based on a sequence relies on a table existing in the current folder. This is not the case for this type of table.
A counter based on a database sequence can only allow one numbering sequence (therefore at folder level) and cannot be reset to zero.