Automatic incrémentation
hello, is it possible to increment a counter after creating a new record?
example: automatic incrementation of an invoice number when creating another
thank you
Alain
3 replies
-
@Alain
Yes.. I would put the logic in the “Trigger on Create” ... Here is an example.. I have a Statement of Work (SOW).. and each SOW can have many amendments .. which go in sequential order... So I put the following in the Amendment (Details) Trigger on Create ..
let t := this;
t.(Amendment := max((select Details)[number(SOWS.Id) = number(t.SOWS.Id)].Amendment) + 1)You can use something similar for your Invoices .. or Invoice Line Items tables.
-
Alain
This is how I do it (again on trigger on create)
let before := max((select JobDockets).“Job Bag”);
“Job Bag” := before + 1mine is for a job bag number but ideal is the same
Mel
-
Thank you l“ll try
Content aside
- 4 yrs agoLast active
- 3Replies
- 430Views