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.
Salesorders for a Customer ID
In a Suitelet, the search I'm running to get a list of salesorders for a particular Customer ID returns lots of duplicates.
This is the code I'm using in the SuiteScript:
var curCustomerID = "123456"; // this number comes for elsewhere
var filters[0] = new nlobjSearchFilter('entity', null, 'is', curCustomerID);
var columns[0] = new nlobjSearchColumn('internalid');
var searchResults = ""; searchResults = nlapiSearchRecord('salesorder', null, filters, columns);
With the above, I get a list of salesorders internal IDs, which is exactly what I want.
The list will contain mostly duplicates. I don't see a pattern to why their are so many duplicate internal IDs. Some IDs are duplicated up to 15 times, some only 6, etc.