nlapiSearchRecord can return only upto 1000 rows. But there is a work around to retrieve more than 1000 rows. This can be done by first sorting the result based on internal id and then using while loop and use concat method to get all results by internalid number as a filter inside the while loop. The sample code is given below: var filters = new Array(); filters[1] = new nlobjSearchFilter('mainline',null,'is','T'); var columns = new Array(); columns[0] = new nlobjSearchColumn('internalid').setSort(); //sort the result based on internalid var results = nlapiSearchRecord('transaction',null,filters,columns); //search record var completeResultSet = results; //copy the result while(results.length == 1000){ //if there are more than 1000 records var lastId = results[999].getValue('internalid'); //note the last record retrieved filters[2] = new nlobjSearchFilter('internalidnumber',null,'greaterthan',lastId); //cre
Comments
Post a Comment