hello, is it possible to increment a counter after creating a new record?
example: automatic incrementation of an invoice number when creating another
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.
This is how I do it (again on trigger on create)
let before := max((select JobDockets).“Job Bag”);
“Job Bag” := before + 1
mine is for a job bag number but ideal is the same
Thank you l“ll try
- 3 yrs agoLast active