Check out Oracle NetSuite upcoming events and conferences here
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!
Update your Profile with your Support type to get your Support Type badge.
Expand your NetSuite knowledge by joining our Ask A Guru Live sessions. RSVP on this event now.
Community Poll: What sort of content would you like to see more of?

NSC | Check Duplicate Order numbers

edited May 30, 2024 4:58PM in SuiteCloud / Customization

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)

Howdy, Stranger!

Log In

To view full details, sign in.


Don't have an account? Click here to get started!


Community Whiz

Quarter 2 (Apr-Jun 2024)

This Week's Leaders

This Month's Leaders

All Time Leaders