Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
NetSuite has launched SuiteSuccess Wholesale Distribution Edition, in Japan. Please join us the webinar on February 12 that introduces NetSuite solution with demos and case studies for Wholesale Industry.
Register Now
NSC | Check Duplicate Order numbers
In some cases, a user may need to warn users that there are potential duplicate records. To achieve this, a user would like an error message to be displayed once the user creates an Sales Order with an existing Order Number already used with the same customer. This is achievable through Scripts
Execute a Search:
var searchResult = nlapiSearchRecord('salesorder', null, filters, columns);
if(searchResult != null)
{
for(var x=0; x < searchResult.length; x++)
{
var customerID = searchResult[x].getValue('entity');
nlapiLogExecution('DEBUG','Customer ID',"Customer ID: "+ customerID)
var customerPurchOrd = searchResult[x].getValue('otherrefnum')
nlapiLogExecution('DEBUG','Sales Order Number',"Sales Order Number: "+ customerPurchOrd)
