0

Alright I've noticed that occasional when I do a saved search in Netsuite, or run a search in suitescript that it returns duplicate records. The only difference that I can see is the memo field. Is it showing the 3 records because it saved the other versions with different memos? Can I turn that off or filter it out?

Here's example pic of Saved Search.

Now for the suitescript

var filter = new Array();
var d = '3/8/2016';
var date = nlapiStringToDate(d);
filter[0] = new nlobjSearchFilter('trandate', null, 'on', date);
var search = nlapiSearchRecord('salesorder', null, filter);

Here's what the result search array looks like.

Now as you can see It returns each internal id 3 times. Any help would be appreciated.

ceridian
  • 51
  • 1
  • 5

1 Answers1

4

Duplicate of Netsuite Suitescript API - Searching Transaction records returns duplicates

As TonyH mentioned in his comment, you need to use the mainline filter for any transaction searches. Without it, NetSuite returns one result for the transaction itself as well as one result for each item line and shipping line on the transaction. If you only want the result for the body of the transactions, filter by mainline = 'T'

Community
  • 1
  • 1
erictgrubaugh
  • 8,519
  • 1
  • 20
  • 28