This demonstrate how to use nlobjSearchFilter for select/multiselect fields.
On this sample code, the user wants to search all Sales Orders where Department is HR or Sales.
function SearchSOs()
{
var filters = new Array();
filters[0] = new nlobjSearchFilter('mainline', null, 'is', 'T');
filters[1] = new nlobjSearchFilter('class', null, 'anyof', ['1','13']); // 1 - Internal ID of HR; 13 - Internal ID of Sales
var results = nlapiSearchRecord('salesorder', null, filters, null);
for (var i in results)
{
//process record
}
}
No comments:
Post a Comment