query.PagedData

Note:

The content in this help topic pertains to SuiteScript 2.0.

Object Description

A set of paged query results. This object also contains information about the set of paged results it encapsulates.

Use Query.runPaged() or Query.runPaged.promise() to create this object.

For paged queries, the maximum number of result rows per page is 1000. The minimum number of result rows per page is 5, except for the last page in the result set (because the last page may include fewer than 5 results).

Supported Script Types

Client and server scripts

For more information, see SuiteScript 2.x Script Types.

Module

N/query Module

Methods and Properties

PagedData Object Members

Since

2018.1

Syntax

Important:

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
}); // Fetch results using an iterator
var iterator = myPagedResults.iterator();
iterator.each(function(resultPage) { var currentPage = resultPage.value; var currentPagedData = currentPage.pagedData; log.debug(currentPage.pageRange.size); return true;
}); // Alternatively, fetch results using a loop
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 

          

Related Topics

N/query Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices