1. Home
  2. Administrators
  3. Formulas
  4. JavaScript functions
  5. getSequence, setSequence and peekSequence functions – Sequence Management

getSequence, setSequence and peekSequence functions – Sequence Management

A sequence is used to generate unique sequential integer values. JavaScript functions are available to control a sequence in Docuo:

Docuo.getSequence(name)

Gets a new value from the sequence.

Name is a text literal that indicates the name of a sequence, the first time a new name is called this function will return a 1, in successive calls this value will be incremented sequentially one by one.

Docuo.setSequence(name, value)

Sets a new value to a sequence or deletes the sequence.

Name is the name of the sequence to be set or deleted and Value is the new number we want to assign to it. When Value is less than or equal to zero the sequence is eliminated.

Docuo.peekSequence(name)

Gets the current value of the sequence without incrementing it.

Name is the name of the sequence to be inspected. The function returns the next number that Docuo.getSequence would return without automatically incrementing its value.

Updated on 29 de March de 2023
Was this article helpful?

Related Articles