Copy link to clipboard
Copied
I have created a form with an invoice template.
I would like the invoice number to auto populate in sequence. I have created that field, named it Invoice Number and believe I need to use the Calculate tab and enter something inside the Custom Calculation Script - am I on the right page? And if so, nothing I insert inside this box stays. I type it in, hit ok and it immediate disappears. Maybe my code is wrong? I have no idea of the correct format but have researched and copied and pasted various data I've found thinking it was correct, and still don't have the desired results.
Please help!
Copy link to clipboard
Copied
What did you try already?
What triggers number to change?
Copy link to clipboard
Copied
I do not know the answers to your questions.
The things I tried already, I didn't save to know what they were.
The invoice number needs to update each time a new invoice is created by the business owner.
Am I in the right place to make this happen in this form?
If so, can you tell me the correct javasript or code to get this action to take place? Thank you so much!
Copy link to clipboard
Copied
You need to know what the trigger to advance number is, for example is it when you open a file, or save file...etc?
What is the format of the number? 1, 001 or something else?
Copy link to clipboard
Copied
I guess it makes sense to have the number advance when the file is opened.
Format of the number should be 1,001.
Copy link to clipboard
Copied
Ok, set the format of the field to number with 0 decimals, and enter value of 1000 to be default value.
Select 'Prepare form' tool, press SHIFT+D or select Document JavaScript from tools.
Enter name for the script (any name) click 'add' and delete anything in the window, and paste this:
this.getField("Text1").value += 1;
Change "Text1" to the name of your field.
Save file and every time document opens it will increase that field value by 1, of course document needs to be saved later.
Copy link to clipboard
Copied
Ok, I've went into the properties of the field, and set the format to Number with 0 decimals.
I do not see a place to enter the default value.
Copy link to clipboard
Copied
It's in the options tab.
Copy link to clipboard
Copied
As @PDF Automation Station mentioned, the default value is in the 'Options' tab, or you can just close 'Prepare form' tool and enter the value manually.
Copy link to clipboard
Copied
Ok, thank you both for that... I got that part done... now I'm wanting to have a total column that will multiply 2 other columns to show what it equals in the total column - can you tell me how I can that?
I really do appreciate your time to help me today!
Copy link to clipboard
Copied