Discussions
SuiteWorld is the largest annual gathering of the NetSuite community! It will be held in Las Vegas on October 6-9, 2025. Our customers and partners look forward to SuiteWorld every year as a place to hear the latest from NetSuite, get hands-on learning, and connect with each other. 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)