Auto Numbering of a Custom Field
Hi All,
I created a custom field in a customer invoice. I want it to work like the document number wherein it will automatically generate a number upon saving the transaction. How can I do this? Is this possible?
Thanks!
First option that requires no planning for concurrency is to create a custom record type that uses auto numbering and creates a new custom record for every invoice and use its name as your custom field’s value
Second option that requires planning for concurrency is to use a custom record to store the next number you want to assign in a custom field. Load that custom record, get its number, update the old one by 1, save the custom record, then set your custom fields number to the number from the custom record. Expect to learn from the SAFE guide how to handle concurrency to handle cases where 2 invoices are created at the same time.
Hi,
This can be a tricky one when it comes to avoiding duplicates.
There’s nothing to do it as standard but there are some option we can explore.
How come you need a separate number and could it be based on the invoice number, for example?
Thanks,
Chris
Hi Chris,
Yes we need an additional field for the invoice number.
Is this possible? What are the options to do this?
Thanks in advance!