Copy link to clipboard
Copied
I need a unique invoice number to show in the corner of a form. I was thinking of the best way (maybe the easiest?) to generate a number.. I want the form when opened to automatically create this number. In addition, one the PDF has been filled out and so on, then saved, I dont want that invoice number to regenerate once its opened again for whatever the reason. Does this sound possible?
My bad... The code should be:
this.getField("Invoice No").value = util.printf("%06d", Math.floor((Math.random() * 1000000) + 1));
Copy link to clipboard
Copied
Thank you very much try67 you have saved me many many hours (or milliseconds).
Copy link to clipboard
Copied
I entered the code, but it does not automatically change the number. I have to go into the calculation field in the form, open/close, save and then I get a new number. This is the code I used.
Copy link to clipboard
Copied
You should not use the code as a calculation script, but as a doc-level script.
Copy link to clipboard
Copied
I tried it there too. Still does not auto populate the numbers.
Copy link to clipboard
Copied
Check the JS Console for error messages.
Copy link to clipboard
Copied
I use"Fill and sign pdf forms" in my android device , what script need to use becose in this soft. Have only save buton, and when i click change original file name.(Maybe need me when save , or save as file)
Copy link to clipboard
Copied
Hello i'm a novice when it comes using the PDF unique numbers, and the code. I have multiple log in portals that are assigned to different team members. When a member logs in I want to have a unique id populate. Will the methods that have been explained work for me in this instance or will I run into trouble since their are multiple portals utilizing the same PDF?
Once the PDF is filled out I have a submit button that will e-mail the PDF to the correct party members. At this point I want the unique number to be saved in my DB so it won't be utilized again.
Am I in over my head here, or is this something I can easily accomplish? Or would making a single portal with one user name and one password be the necessary route to accomplish the process?
Any advice and or assistance will be greatly appreciated. Thank you in advance. This article has already been extremely helpful in my form.
Copy link to clipboard
Copied
You can use the code above to generate random invoice numbers.
You can then export the form data and import it into your DB, but you can't prevent duplicates from happening (at least not at the PDF level). However, if you use a long random number (for example, 10 digits long), the chances of that happening are minuscule.
Copy link to clipboard
Copied
Could I link the log in portals to start the invoice number with letters specific to the user? Example: ms-10010001 or bg-10010001 so only my numbers could be duplicated but they would still be unique since the serial has a static value?
Thank you for responding so quickly...This thread has been extremely useful for this process.
Copy link to clipboard
Copied
That's going to be tricky... Why not simply assign the invoice numbers on your end, after the files have been submitted back to you?
Copy link to clipboard
Copied
When you say assign invoice numbers on my end do you mean manually?
I'm going to have multiple users 500+ given access to the PDF...When the PDF is submitted to my DB I'm tracking who the PDF belongs to in the even a customer calls me concerning their product....as long as they have the ID number that is on their copy of the PDF i'll have a copy available to know what their agreement is.
Your assistance is greatly appreciated. Thank you in advance.
Copy link to clipboard
Copied
Is it possible to "Lock" and "Unlock" the automatically generated invoice number? Thank you.
Copy link to clipboard
Copied
hi there,
can somebody help me to creat a new PDF Invoice Form which it will automate the invoice numbering for every new invoice.
thanks in advance.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
I need help. I have been reading all the threat and I'm still not getting the pdf auto generate the number. Can someone explain me how to do it? I'm newby, but I need to create a PDF that can generate the number when its open. Thank you in advanced!