Search.runPaged(options)
You must specify a sorting order in the search definition when using this method to avoid duplicate or missing results. The query definition must provide a unique and unambiguous sorting order with a specified precedence.
Method Description |
Runs the current search and returns summary information about paginated results. Calling this method does not give you the result set or save the search. To retrieve data, use PagedData.fetch(options).
Important:
When you use this method to run a paged search, consider the following:
|
Returns |
|
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
5 units |
Module |
|
Since |
2016.1 |
Parameters
The options parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
number |
optional |
Maximum number of entries per page There is an upper limit, a lower limit, and a default setting:
|
Errors
Error Code |
Thrown If |
---|---|
|
An unknown search parameter name is provided. |
|
An unsupported value is set for the provided search parameter name. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/search Module Script Samples.
//Add additional code
...
var mySearch = search.create({
type: search.Type.CUSTOMER
});
// Run the paged search
var pagedData = mySearch.runPaged({
pageSize: 50
});
...
// Use the count property to count the
// search results easily
var resultCount = mySearch.runPaged({
pageSize: 50
}).count;
...
//Add additional code