Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Merged branch "DOC0000342" into parent
Autoincrement

Обязательное условие, чтобы у тебя префикс стал автоинкрементируемым и отображался у объекта, у него должно быть стринговое поле, number которое называется, и после этого ты можешь сделать свой префикс, который будет только в этом поле отображаться. Этот момент надо сформулировать и записать, чтобы было в быстром доступе.

Autoincrement is a function that operates with record numbers. It automatically generates a new record number increased by 1.

It can be used for various purposes. One of them, for example, is registering inquiries user queries for their further processing and statistical purposes.

Autoincrement settings Autoincrement settings are stored in two tables:

The

the Number (sys_number) table contains the Maximum digits, the Prefix,and the

Prefix

Start Value settings for the table

;
  • The Autoincrement (sys_number_autoincrement) table stores the autoincrement setting related to the table.
  • Tip

    For working correctly, records in both tables must be created. If the record in the Number (sys_number) table exists and the record in the Autoincrement (sys_number_autoincrement) table is not, then it will be created automatically, and the numbering will start with 1,

    .

    In order to create an autoincrementTo create an autoincrement rule, the following criteria must be met: the

    • The object for which you are configuring an autoincrement
    for
    • must have a field that should be incremented.
    It must have a String type, and generally, these fields are named as "Number"
    • The field should be of String type. These fields are usually named “Number”.

    If your table does not have this field, please create it: please refer . Refer to the related Create Columns article for more informationCreating Objects#Howtocreateacolumn.

    1. Navigate to System Definition → Numbers;
    2. Click New, fill in the form and then click Save.

    .

    Record Number form Autoincrement form fields

    Field

    Mandatory

    Description

    Maximum digitsYDefine the max number of digits Maximum digits amount possible after the prefix.
    AutoincrementEnter the start point for the numbering. An incremental step is always 1, so further entries in this table will have the number increased by 1.
    PrefixYSpecify at PrefixAt least three Latin letters that will be the starting point beginning of every record ID in this table.
    Start ValueYSpecify the initial value of the sequence. The default value is '1'. 

    Example

    Info

    You just created the

    rule

    sequence, and you filled in the fields:

    Field

    Type

    Value

    Maximum digits

    -

    Small Integer

    6

    Prefix
    - ABCAutoincrement - 123

    String

    ABC

    Start Value

    Integer

    22

    So the first record ID will be

    ABC000124

    ABC000022, and the further ones will be

    ABC000125

    ABC000023,

    ABC000126

    ABC000024, and so on.

    If the value of the Start Value changes, and it is greater than the current value of the sequence, the value will be saved, and the sequence will be set to a new starting value.

    Note
    • If you create a record in the Record Number (sys_number)table, a sequence is created.
    • If you delete a record in the Record Number (sys_number)table, the sequence is deleted.