Skip to content

Instantly share code, notes, and snippets.

@rhaseven7h
Created January 23, 2014 06:00
Show Gist options
  • Save rhaseven7h/8573669 to your computer and use it in GitHub Desktop.
Save rhaseven7h/8573669 to your computer and use it in GitHub Desktop.
This is a generic way of fetching more than 1000 rows from a search in NetSuite.
console.clear();
var res;
var rows = new Array();
res = nlapiSearchRecord("customrecord_tel_tarifas_globales", null, null, null);
if(res) {
rows = rows.concat(res);
while(res.length == 1000) {
var lastId=res[999].getId();
res = nlapiSearchRecord(
"customrecord_tel_tarifas_globales",
null,
[
new nlobjSearchFilter("internalIdNumber", null, "greaterThan", lastId),
],
null
);
if(res) {
rows = rows.concat(res);
}
}
}
console.dir(rows);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment