Discussions
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.