Copy link to clipboard
Copied
I made a form and it has a field named Performance with a simplified field annotation calculation and percentage applied, I calculate with the name of the fields indicated: (current/previous-1). But when i wrote in others fields the Warning appears: javascript warning - value does not match field. Could someone help me take this warning out of my form and the calculation work?
Thanks
Use this code as the field's custom calculation script:
var v1 = Number(this.getField("current").valueAsString);
var v2 = Number(this.getField("previous").valueAsString);
if (v2==0) event.value = "";
else event.value = (v1/v2)-1;
Copy link to clipboard
Copied
This happens when you divide a value by zero.
Copy link to clipboard
Copied
Thank you for your help!
Copy link to clipboard
Copied
Use this code as the field's custom calculation script:
var v1 = Number(this.getField("current").valueAsString);
var v2 = Number(this.getField("previous").valueAsString);
if (v2==0) event.value = "";
else event.value = (v1/v2)-1;
Copy link to clipboard
Copied
Thank you very much! Finally my form works without a warming!!!!!!