Copy link to clipboard
Copied
Hi,
Am trying to come up with the script to compare the numerical value in Field 'A', and compare it to the numerical value in Field 'B', and if numerical value 'A' is greater than numerical value 'B', add text "NO", and if numerical value 'A' is less than value 'B', add text "YES" (otherwise field is blank). The "YES" or "NO" would be added to a field 'C'.
I'm sure its fairly straightforward, but can't seem to fathom....
Use this code as FieldC "Custom Calculation Script":
var a = this.getField("FieldA").value;
var b = this.getField("FieldB").value;
if(a > b){
event.value = "NO";
}else if(a < b){
event.value = "YES";
}else
event.value = "";
Copy link to clipboard
Copied
Use this code as FieldC "Custom Calculation Script":
var a = this.getField("FieldA").value;
var b = this.getField("FieldB").value;
if(a > b){
event.value = "NO";
}else if(a < b){
event.value = "YES";
}else
event.value = "";
Copy link to clipboard
Copied
Thanks Nesa....thats great 😉