function time() { var stdate = Xrm.Page.getAttribute("new_starttime").getValue(); var endate = Xrm.Page.getAttribute("new_finishtime").getValue(); if(stdate == null && endate == null) { alert(“Please enter the Start Time / Finish Time…”); return false; } else if(stdate==null) { alert(“Please enter the Start Time !”); return false; } else if(endate==null) { alert(“Please enter the Finish Time !”); return false; } var st=stdate.getTime(); var ed=endate.getTime(); var sdiff=(ed-st); var h=(sdiff/60/1000); var p=parseInt(h); var tm=p.toString(); Xrm.Page.getAttribute("new_timespent").setValue(tm); }
*This post is locked for comments