function xxx(type,name)
{
if (name == 'custrecord54'); // id of the custom date field
{
var date = new Date(); // get today's date and get the seconds, hours and minutes
var dt = date.getUTCSeconds();
var hours = date.getUTCHours();
var min = date.getUTCMinutes();
var da = nlapiGetFieldValue('custrecord54'); // get the custom date field value
var da1 = nlapiStringToDate(da);
// set the seconds to be larger than what time new date object has for it to differentiate
da1.setUTCSeconds(dt+1);
da1.setUTCHours(hours);
da1.setUTCMinutes(min);
if(date > da1)
{
alert("xxxxxxxxxxx");
return true;
}
}
return true;
}
No comments:
Post a Comment