Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Search for Messages for Purchase Orders
I need a search that will return the Email messages for Purchase Orders. This is the code that I have:
var columns = new Array(); columns[0] = new nlobjSearchColumn( 'subject' ); columns[1] = new nlobjSearchColumn( 'isincoming' ); var filters = new Array(); filters[0] = new nlobjSearchFilter( 'messagetype', null, 'is', 'EMAIL', null); filters[1] = new nlobjSearchFilter( 'mainline', 'transaction', 'is', 'T', null); filters[2] = new nlobjSearchFilter( 'type', 'transaction', 'is', 'Purchase Order', null); var searchresults = nlapiSearchRecord( 'message', null, filters, columns); for ( var i = 0; searchresults != null && i < searchresults.length ; i++ ) { var subject = searchresults[i].getValue('subject'); It doesn't return anything. When I remove the line:
filters[2] = new nlobjSearchFilter( 'type', 'transaction', 'is', 'Purchase Order', null);
0