Skip to main content
Inspiring
September 16, 2022
Answered

PDF auto numbering for Invoices

  • September 16, 2022
  • 1 reply
  • 1926 views

I need to add unique invoice number to a form that will auto-populate the new number every time the form is saved. The number needs to be 2022-IN-20000 with the new number following as 2022-IN-20001 and so forth. Can anyone help? Thanks

This topic has been closed for replies.
Correct answer Charles5C81

This works perfectly. Thank so much for your help and have a great week. 


I am noticing one problem if you can help. When I add my digital signature to the document and save it and then reopen the saved document later it advances the saved number to the next number. Saving the document after signing marks all fields as read only and I cant change the number back. Is there a way to lock that number once it is saved so that it wont advance when I reopen it later. 

1 reply

try67
Community Expert
Community Expert
September 16, 2022

Will there be only one copy of this file? If not, you will get duplicates values, as one copy can't know which numbers have been used by the other.

Inspiring
September 16, 2022

There will only be one copy for each number. I am a Justice of the Peace and this is a form that I open and fill out each time I conduct an Inquest and each form has to have a separate case number that runs in order. After I fill the form out, I save it to a file on my computer. The number needs to start with 2022-IN-20000 and advance to the next number each time the document is saved. Thank you!

Inspiring
September 19, 2022

You have to save the file when closing it for the number to update, as you've requested.


Thank you very much for your help. I have one last request of you if you will. Can you change this code so that the number will advance when the document is opened instead of when it is saved? Thank you.