Updating a field via Client Script
Hi all,
I'm trying my hand at Client Scripts and am running into an issue, that admittedly is probably just JS ignorance on my end.
I have a module where formula fields contain numbers. Here is the code that I'm using to try to add those values together..
var taxScore = ZDK.Page.getField('Tax_Score').getValue();
var wealthScore = ZDK.Page.getField('Wealth_Score').getValue();
var apScore = ZDK.Page.getField('A_P_Score').getValue();
var retireScore = ZDK.Page.getField('RPD_Score').getValue();
var healthScore = ZDK.Page.getField('Health_Score').getValue();
var pcScore = ZDK.Page.getField('Insurance_Score').getValue();
var surveyScore = taxScore + wealthScore + apScore + retireScore + healthScore + pcScore;
var score = surveyScore.toString();
var updateScore = ZDK.Page.getField('Total_Score');
updateScore.setValue(score);
If I run a log() on any of the variables, I get the correct value, but the Total_Score field never gets updated.
Any thoughts?
Just a little clarity, Total Score is a single line text field, that's why I am converting it to a string. Also, there is a Canvas on this, and the Event Details on the client script is Page Event and onLoad.