Sequences

Sequences are number series that templates use to assign sequential numbers, such as order numbers or travel order numbers. The Sequences page lists all sequences with their current value and when each was last used, and you can change the value manually. The page is available to administrators. To open it, go to the Administration menu and click the Sequences tile in the Application management and configuration group.

No.ElementPurpose
1CloseReturns you to the Administration menu.
2SequenceThe name the template uses for the sequence. Can be filtered.
3IDThe last assigned number. Can be filtered.
4Last usedWhen the sequence last assigned a number or when you last edited it. By default, the table is sorted with the most recently used sequences first.
5EditOpens a dialog for changing the number. Double-clicking a row does the same.
6Record countThe number of sequences in the table.
7DensityRow density: compact, standard or comfortable.
8ColumnsSelects which columns are displayed.
9ExportExports the table to a file.

How a sequence is created

You cannot create or delete sequences on this page. A sequence is created automatically the first time a template calculation uses it. A new sequence starts at 0, so the first assigned number is 1. Each subsequent use returns a number 1 higher. Two simultaneous calls never receive the same number.

Template authors use a sequence in a calculation with these functions:

FunctionWhat it does
lib.getSequenceNumber('NÁZEV')Returns the next number of the sequence NÁZEV. If the sequence does not exist, it creates it.
lib.getSequenceNumberCond('NÁZEV', podmínka)Assigns a number only if the condition is met. Otherwise it returns nothing and no number is used up.

Example of a fixed-length order number: const cislo = lib.fnStrPad(lib.getSequenceNumber('TAS-PO-202610'), 4, '0'); returns, for example, 0009. If the template builds the sequence name from the year and month (like TAS-PO-202610 in the list), numbering restarts from 1 every month, because a new sequence is created each month.

A variable sequence is a different feature
A template variable with the sequence property has its own counter, which is filled when a case is created. That counter does not appear on this page.

Editing a sequence ID

FieldPurpose
Sequence IDRequired. The new last assigned number, a whole number of 0 or greater. The next assigned number will be 1 higher.
SaveSaves the number. Pressing Enter does the same. The change is written to the application log.
CloseCloses the dialog without making changes.

How to shift the numbering

  1. In the Sequence column, find the sequence name.
  2. At the end of the row, click the pencil icon.
  3. In the Sequence ID field, enter the last number that has already been used. If the next order should get number 101, enter 100.
  4. Click Save.
Lowering the number causes duplicates
If you enter a number lower than one the sequence has already assigned, new cases will get numbers that already exist. Lower the number only if you know the higher numbers are not used anywhere.

Related: Scripts, Configuration.

Scripts

System Status

Syca (opens in a new tab)

Powered by HelpDocs (opens in a new tab)