Is there a way to limit the number of results retu...
# suitescript
d
Is there a way to limit the number of results returned in a search from the getInputData stage of a MapReduce script?
e
You can use the
formulanumeric
formula; `
Copy code
search.createFilter({name: 'formulanumeric', operator: 'lessthan', formula: 'rownum', values: '75001'})
👀 1
a
Nothing native that can do that. You'd have to manually limit results inside the getInputData function.
m
return search.load({id: 1234}).run().getRange({start:0, end: 1000})
will get you the first 1000 if you’re looking for a quickish fix. otherwise yeah, a bigger getInputData function to run the search and build up an array