Hello,
I have been trying to obtain a total difference between 3 fields to be formulated for my final field at the bottom of my document.
Here is an example since the document is on a secure network.
Example:
Field 1 - (Field 2 + Field 3) = Total Difference (in my case I want this to equal Zero)
---------
I have tried multiple different custom formulas but so far either get a syntax error with script or it allows the script to be entered but the will not work once I begin to fill out the form to test out all of its applications.
so far I have found:
[Field# merely where the real title would be placed]
var v1 = getField("Field1").value;
var v2 = getField("Field2").value;
event.value = v1 - v2;
--------
This formula I believed would work but even without restructing it to fit my own requirements this formula did not gather any information nor caluclate it but merely left a big old Zero in the section I wanted the fields calculated difference to be entered in.
Any help with this issue would be greatly appreciated.
To use the simplified field notation option, be sure there are no spaces in the field names and the following should work:
Field1 - Field2 - Field3
The following custom Calculate script should do the same thing:
(function () {
var v1 = +getField("Field1").value;
var v2 = +getField("Field2").value;
var v3 = +getField("Field3").value;
event.value = v1 - v2 - v3;
})();
Also, be sure that the field calculation order is correct. If you don't know what this is, post again.
North America
Europe, Middle East and Africa
Asia Pacific