Discussions
Read on for the latest updates including:
• Agenda Builder launch
• SuiteWorld On Air registration
• New NetSuite Prompt Studio Contest
• And more!
Check out this thread to 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'));