function BuisnessHourtooktocompletetask_onload()
{
alert("Test");
var stdate=Xrm.Page.getAttribute("new_starttime").getValue();
var endate=Xrm.Page.getAttribute("new_endtime").getValue();
if(stdate==null && endate==null)
{
alert("Please enter the Start Time / Finish Time…");
return false;
}
if(stdate==null)
{
alert("Please enter the Start Time !");
return false;
}
if(endate==null)
{
alert("Please enter the Finish Time !");
return false;
}
var st=stdate.getTime();
var ed=endate.getTime();
var sdiff=(ed-st);
var Buisness hour took to complete task=(sdiff/60/1000);
var p=parseInt(h);
var tm=p.toString();
Xrm.Page.getAttribute("new_buisnesshourtooktocompletetask").setValue(tm);
}
// Avoid `console` errors in browsers that lack a console.
(function() {
var method;
var noop = function () {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
'timeStamp', 'trace', 'warn'
];
var length = methods.length;
var console = (window.console = window.console || {});
while (length--) {
method = methods[length];
// Only stub undefined methods.
if (!console[method]) {
console[method] = noop;
}
}
}());
if(typeof console =="undefined")
{
this.console = {log: function() {}};
}
this is my code.. everything is fine i think