Hello @hheyhey568
You don’t need the getField().setVal() to assign the equation’s result to the calculated field. For example, if the want to sum two fields’ values (fieldname1 and fieldname2), the equation would be only SUM(fieldname1, fieldname2) or fieldname1+fieldname2
You don’t need to assign the values explicitly.
Best regards.
Hello CFF Team,
Thanks for the reply.
My question is :
Lets say I have only one calculated field which calculates Variable1 , variable2,variable3 upto variable 20.This is the only calculated field which has the code in it.
To check the errors , I want to see the value of all the variables.
To do this , I make many calculated field and then use getField().setValue() method in the main calculated field having code.
This make me create many calculated field and need to put getField().setValue() method for each variable in the main calculated field ( the one having the code).
So I am asking , is there any way which let me see the value of all the variables without creating lots of calculated field?
May be there a way which print all the variables hitting print button?
This will save a lots of time to quickly check which variable has error in formula.
regards,
Hello @hheyhey568
No solution satisfies all situations. The code to use will depend on the form structure and the equations.
For example, assuming you want to generate the variables v1, v2, and v3 from the equation entered into the fieldname1 field, and use these variables from equations in the calculated fields fieldname8 and fieldname9 (it is a hypothetical example).
You can implement the equation in the fieldname1 as follows:
(function(){
v1 = fieldname2+fieldname3;
v2 = fieldname2*fieldname3;
v3 = POW(fieldname2,fieldname3);
return fieldname2/fieldname3;
})()
The fieldname8 and fieldname3 equations must include the fieldname1 to force the evaluation of these equations after evaluating the equation of the fieldname1, even if you don’t need to use it.
For example, in the equation of the fieldname8 could be:
(function(){
var tmp = fieldname1;
return v1+v2;
})()
Best regards.