Przejdź do głównej zawartości

RegisterNextNumber()

A RegisterNextNumber() function registers a specified number for the current case so other cases will not be able to assign the same number for the same key.

RegisterNextNumber(NumberType,SearchKey,DateValue,Number);
  • NumberType – (String) an identification key for the given autonumbering. The maximum length is 100 characters;
  • SearchKey – (String) a key for which numeration will be created;
  • DateValue – (DateWithTime) a date for which the unique number will be registered;
  • Number – (String) a number to be registered.

This function returns Boolean. The RegisterNextNumber() function returns true if the number has been registered successfully. If the number was already in use then this function returns false.

Try to register a unique number for „DocumentTypeA” type of cases for the given [Employee] at a specified date.

if (!RegisterNextNumber("DocumentTypeA",[Employee],[Registration date],[Number])
{
ShowMessage(1,"Number is already in use by another case.");
}

See also: FindAndRegisterNextNumber()