Monday, April 22, 2019

Filtering nlapiSearchRecord using Array of values that are not select/multi-select fields or integer value

This search below searches for all sales orders and vendor bill records. Notice that the filter used is recordtype which is not a select/multi-select type of field.

function searchSOandBill()
{

var col = new Array();
var filter = new Array();

col[0] = new nlobjSearchColumn('tranid');

var filterExpression = [[['recordtype', 'is', 'vendorbill'], 'or', ['recordtype', 'is', 'salesorder']], 'and', ['mainline', 'is', 'T']];

var results = nlapiSearchRecord('transaction', null, filterExpression, col);

//rest of code here...

}

No comments:

Post a Comment