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!

Rookie Asked on February 10, 2021 in SuiteScript.
Add Comment
3 Answer(s)

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.

Intermediate Answered on February 12, 2021.
Add Comment

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

Intermediate Answered on February 10, 2021.
Add Comment

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!

Rookie Answered on February 11, 2021.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor