PagedData.fetch(options)
Method Description |
Retrieves a page in the set of pages included in the |
Returns |
|
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Parent Object |
|
Sibling Object Members |
|
Since |
2018.1 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
number |
required |
The index of the page to retrieve. Page indexes start at 0. |
Errors
Error Code |
Thrown If |
---|---|
|
The value of the |
|
The value of the |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/query Module Script Samples.
// Add additional code
...
var myCustomerQuery = query.create({
type: query.Type.CUSTOMER
});
myCustomerQuery.columns = [
myCustomerQuery.createColumn({
fieldId: 'entityid'
}),
myCustomerQuery.createColumn({
fieldId: 'firstname'
}),
myCustomerQuery.createColumn({
fieldId: 'email'
})
];
var myPagedResults = myCustomerQuery.runPaged({
pageSize: 10
});
for (var i = 0; i < myPagedResults.pageRanges.length; i++) {
var currentPage = myPagedResults.fetch(i);
var currentPagedData = currentPage.pagedData;
log.debug(currentPage.pageRange.size);
}
...
// Add additional code