Utility.IncrementCounter(Counter[, Digits])
.IncrementCounter() returns the next number in the increment sequence for the given counter name.
Applies To
Description
The Utility.IncrementCounter() returns the next number in the increment sequence for the given counter name. This is the same process that DEACOM uses for setting sales order, purchase order, and job numbers.
Properties and Methods
None
Available
The .IncrementCounter(Counter[, Digits]) method is available in:
- 15.03.016
- All newer builds
Type
Int32
Syntax
Utility.IncrementCounter(Counter[, Digits]);
Parameters
|
Parameter |
Required |
Description |
|---|---|---|
|
Counter |
Yes |
A unique identifier (string) for a counter stored in DEACOM |
|
Digits |
No |
The number of digits in the counter before it resets. The default value if not given is 5. When the counter reaches 99999 (five digits), then it will reset to 0. |
Example
Event.Form.YesNo('Set number: ' + Utility.IncrementCounter('Help-Testing'));
Event.Form.YesNo('Set number: ' + Utility.IncrementCounter('Help-Testing'));
/* Expected System Prompt Display:
Set number: 1
Set number: 2
*/