JavaScript–Calculate two fields

Written by admin. Posted in CRM TUTORIAL, TIPS & TRICKS

Tagged: , , , , , , , , ,

Published on October 05, 2013 with No Comments

A friend contacted me the other day to help with a JavaScript issue. ; He needed to calculate a couple of fields and found some code on Internet but wasn’t able to get it to work. ; He found the code at

I took a look at the code and made some corrections. ; For those of you that run into the same issue, I thought I would share the corrected code with you. ;

function calculate ()

var val1 = Xrm.Page.getAttribute(‘new_val1′).getValue();
var val2 = Xrm.Page.getAttribute(‘new_val2′).getValue();


var result = val1 + val2;


– Dynamics CRM – Things I Learn Along the Way

No Comments

Comments for JavaScript–Calculate two fields are now closed.