Hi,
I am trying to sum up few field values and update it to a field through below javascript code. I have added this function in all fields (stl_cpdu1, stl_cpdu2, etc.)...Is this correct?
/Function to add all CPDUs values
function Event_Update_TotalCPDU ()
{
var CalculatedCPDU=
Xrm.Page.getAttribute("stl_cpdu1").getValue() +
Xrm.Page.getAttribute("stl_cpdu2").getValue() +
Xrm.Page.getAttribute("stl_cpdu3").getValue() +
Xrm.Page.getAttribute("stl_cpdu4").getValue() +
Xrm.Page.getAttribute("stl_cpdu5").getValue() +
//Set value for Total CPDU
Xrm.Page.getAttribute("stl_cpdu").setValue(CalculatedCPDU);
}
But, I am getting below error message in the form after entering the value.
@xxxx.xxx.dynamics.com/.../ClientApiWrapper.aspx line 157 > eval:1:1
RunHandlerInternal@xxxx.xxx.dynamics.com/.../ClientApiWrapper.aspx
RunHandlers@xxxx.xxx.dynamics.com/.../ClientApiWrapper.aspx
ExecuteHandler@xxxx.xxx.dynamics.com/.../ClientApiWrapper.aspx
$Ce_1@xxxx.xxx.dynamics.com/.../formcontrols.js
executeHandler@xxxx.xxx.dynamics.com/.../formcontrols.js
executeHandlerByDescriptor@xxxx.xxx.dynamics.com/.../formcontrols.js
getHandler/<@xxxx.xxx.dynamics.com/.../formcontrols.js
getHandler/<@xxxx.xxx.dynamics.com/.../global.ashx
fireOnChange@https:/XXXX.XXX.dynamics.com/_static/form/formcontrols.js?ver=-385382622:12178:13
setValueInternal@xxxx.xxx.dynamics.com/.../formcontrols.js
setValue@xxxx.xxx.dynamics.com/.../formcontrols.js
$3e_2@https:/XXXX.XXX.dynamics.com/_static/form/formcontrols.js?ver=-385382622:25826:9
Function.createDelegate/<@XXXX.XXX.dynamics.com/_static/_common/scripts/MicrosoftAjax.js?ver=-385382622:24:16
b@xxxx.xxx.dynamics.com/.../MicrosoftAjax.js
Thanks,
Praveen.
*This post is locked for comments