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.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Please note that on Saturday, April 18, 2026, at 8:00 PM Pacific Time, our Case Management System will undergo a scheduled maintenance for approximately 15 minutes. During this time, case creation via SuiteAnswers will be unavailable and inbound calls will be routed to Customer Service.
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