I did an invoice search in SuiteScript:
var filt = [], col = [], res;
filt.push(new nlobjSearchFilter('tranid', null, 'is', tranid));
col.push(new nlobjSearchColumn('tranid'));
col.push(new nlobjSearchColumn('entity'));
col.push(new nlobjSearchColumn('trandate'));
col.push(new nlobjSearchColumn('item'));
col.push(new nlobjSearchColumn('quantity'));
col.push(new nlobjSearchColumn('amount'));
col.push(new nlobjSearchColumn('otherrefnum'));
col.push(new nlobjSearchColumn('shipto'));
col.push(new nlobjSearchColumn('shiplabel'));
col.push(new nlobjSearchColumn('shipaddressee'));
col.push(new nlobjSearchColumn('shipaddress1'));
col.push(new nlobjSearchColumn('shipaddress2'));
col.push(new nlobjSearchColumn('shipcity'));
col.push(new nlobjSearchColumn('shipstate'));
col.push(new nlobjSearchColumn('shipzip'));
col.push(new nlobjSearchColumn('shipcountry'));
col.push(new nlobjSearchColumn('rate'));
col.push(new nlobjSearchColumn('trandate', 'createdfrom'));
col.push(new nlobjSearchColumn('shipdate', 'createdfrom'));
col.push(new nlobjSearchColumn('actualshipdate', 'createdfrom'));
col.push(new nlobjSearchColumn('description', 'item'));
res = nlapiSearchRecord('invoice', null, filt, col);
It works fine but my problem is this: Some items on the invoice may be kit items. The members of the kits do not show up in the UI or on the printed invoice,but they show up as search result rows. In fact each member shows up as two rows,one with a positive quantity and amount, and one with a negative quantity and amount. This makes the search useless to me. How can I filter out those member records?
Thanks.