When conducting a search query on Netsuite for transaction records, it is not uncommon to encounter duplicate results.
This can be particularly frustrating, especially when you expect each record to be returned only once.
However, there is a solution to this issue that can help streamline your search and save you valuable time.
By following these instructions, you will be able to retrieve each record only once, eliminating any duplicates.
1. Filter the search:
To eliminate duplicate results, you need to add a filter to your search query. Specifically, you will need to include the filter 'mainline is TRUE'. This filter ensures that only the transaction body itself is returned in the search results, ignoring any line items associated with the transaction.
2. Additional filter for saved searches:
If you are using a saved search via code, it is recommended to add an additional filter to further refine your results. You can achieve this by using the following code:
new nlobjSearchFilter('mainline', null, 'is', 'T')
or
['mainline', 'is', 'T']
This will ensure that the search only retrieves the transaction body, eliminating any line item duplicates.
To demonstrate the use of the filter, consider the following code snippet:
var columns = [];
columns.push(new nlobjSearchColumn('internalid'));
var searchResults = nlapiSearchRecord('transaction', null, ['mainline', 'is', 'T'], columns);
return searchResults;
By incorporating the 'mainline is TRUE' filter for transaction record searches, you can effectively eliminate duplicate results from your search queries.
This filter ensures that only the transaction body is returned, providing accurate and streamlined search results.
Remember to also add the additional filter when using saved searches via code.
By applying these instructions to your Netsuite searches, you will enhance your professional capabilities and improve overall efficiency.