Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Simple Math (JavaScript)

$
0
0

I'm trying to learn JS and create a simple JS function to add up 8 fields and put the total into a variable TT and update a field Total Time with that variable.  

I have it set for onsave on the form but the field is not updating.  These are all whole number/duration fields.  Is there some problem with my JS?

function Form_OnSave() {
// All all of the duration fields in the form

var tt =
(Xrm.Page.getAttribute("new_billabletime").getValue() +
Xrm.Page.getAttribute("new_billabletraveltime").getValue() +
Xrm.Page.getAttribute("new_mfgrwarrantytime").getValue() +
Xrm.Page.getAttribute("new_lunchandbreaks").getValue() +
Xrm.Page.getAttribute("new_warrantytime").getValue() +
Xrm.Page.getAttribute("new_ojttime").getValue() +
Xrm.Page.getAttribute("new_billabletimeot").getValue() +
Xrm.Page.getAttribute("new_billabletraveltimeot").getValue());

Xrm.Page.getAttribute("new_totaltimeaccountedfor").setValue(tt);
}

Thank you


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>