Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Date comparison
Hi,
Following on from my previous question, the script is now working, but the date comparison part of it isn't working quite as I expected.
The check should ensure that if a date before today is selected as the due date, an error message comes up. I thought the code below would allow users to select today's date, or any date in the future. In practice, selecting today's date triggers the error message.
Please could you tell me what I've done wrong.
Thanks,
Sam.
function saveSOCheck()
{
// Validate due date
var despatchDueDateValue = nlapiGetFieldValue('custbody_despatch_due_date');
var despatchDueDate = nlapiStringToDate(nlapiGetFieldValue('custbody_despatch_due_date'));
0