how to add auto numbering
How do I add auto numbering to records on creation please.
5 replies
-
Emphasis, I have tried from information on other threads but still no good as I am getting increments of 10 based on System ID number.
-
See formula on creation of record in table Customer Data (I only have one table for now)
'Customer ID' := max((select 'Customer Data').'Customer ID') + 1
It is incrementing by 10 and not keeping the GP-00
Thanks in advance
-
OK - Changed Customer ID from Text to Number field and now it works.
Just have to work out how to add the suffix GP-00 before each number now :)
-
In order to have the GP-xxx format, the field must be Text.
Then put this code in the Trigger after create (table level)
---
let prefix := "GP";
let count := cnt(select 'Customer Data');
'Customer Number' := prefix + "-" + format(count, "000")---
-
...and remember if you duplicate a record this trigger will NOT fire :-(
Content aside
- 4 yrs agoLast active
- 5Replies
- 1455Views