Copy link to clipboard
Copied
Hi there!
This is probably going to be a super simple one to fix so apologies in advance but I am a total novice in the world of adding calculations in PDF forms. I was supplied an existing excel "Quotation" form which the team in the field use currently to create quotes for customers. It has both "list price" and "contract rate" columns which are populated as soon as the quantity for each line item is added.
I can't add the sheet due to client confidentiality but have added a screen grab of the columns in question so I hope this helps to explain...
Essentially I need to populate the List price column based on a set price multiplied by whatever has been entered into the Qty column for that product... and then the same for the Contract price.
So Qty 1 x 5,500 = List Price 1 and Qty 1 x 2,250 = Contract Price 1
I'm not afraid to say I am an utter muppet and just can't seem to get my head around this! Please help!
At the bottom of the form there is then the "sub total", "GST" (which is tax of 10% on cost of products here in Oz), "sub total + GST" and finally "Amount Due" I gather I can do simple calculations for these but it is the List price and Contract Price calculations that are stumping me....
Many thanks in advance for helping me.....
CHeers,
Suz
Copy link to clipboard
Copied
Custom calculation script for "List Price 1":
event.value = Number(this.getField("Qty 1").valueAsString) * 5500;
Custom calculation script for "Contract Price 1":
event.value = Number(this.getField("Qty 1").valueAsString) * 2250;
Copy link to clipboard
Copied
You can also do it without using a script, via the Simplified Field Notation option, like this:
Qty\ 1 * 5500
Note the space in the field name needs to be escaped (by adding a back-slash before it).
Copy link to clipboard
Copied
Custom calculation script for "List Price 1":
event.value = Number(this.getField("Qty 1").valueAsString) * 5500;
Custom calculation script for "Contract Price 1":
event.value = Number(this.getField("Qty 1").valueAsString) * 2250;
Copy link to clipboard
Copied
You can also do it without using a script, via the Simplified Field Notation option, like this:
Qty\ 1 * 5500
Note the space in the field name needs to be escaped (by adding a back-slash before it).
Copy link to clipboard
Copied
You are AMAZING! Thank you - not only for taking the time to respond to what was clearly (embarrassingly) such a simple thing - but for giving me 2 ways of doing it.... that backslash tip explains why it wasn't working when I was trying to do what I thought was a rational calculation....
Copy link to clipboard
Copied
You're welcome! Unfortunately, the back-slash thing is not documented anywhere official (as far as I know), or at least it's buried deep in some help page, so figuring out how it should work on your own is nearly impossible...
Copy link to clipboard
Copied
Tip: if those in the field aren't going to be using PCs - for example they are using iPads -- check everything very carefully. A lot of things don't work and can't work on iPads. You also need to be sure they use the app you test with, rather than one they prefer.

