PagedData Object Members in SuiteScript 2.0
PagedData object in SuiteScript 2.0 offers methods and properties for handling paged query results efficiently.
The PagedData object in SuiteScript 2.0 is essential for developers managing paged query results, providing a comprehensive set of methods and properties to streamline data retrieval.
What is the PagedData Object?
The PagedData object encapsulates a set of paged query results, allowing developers to work with extensive datasets effectively. This object can be created using the Query.runPaged(options) or Query.runPaged.promise(options) methods. Each call can return up to 1000 results per page, streamlining the handling of large data results in NetSuite.
What Are PagedData Object Members?
The PagedData object includes various methods and properties designed for efficient data manipulation. Below is a summary of these members:
Methods
| Member Name | Return Type | Supported Script Types | Description |
|---|---|---|---|
PagedData.iterator() | Iterator | Client and server scripts | Standard SuiteScript 2.0 object for iterating through results. |
PagedData.fetch(options) | query.Page | Client and server scripts | Retrieves a page in the set of pages included in the PagedData object. |
PagedData.fetch.promise(options) | Promise Object | Client and server scripts | Asynchronously retrieves a page in the set of pages included in the PagedData object. |
Properties
| Property Name | Type | Description |
|---|---|---|
PagedData.count | number (read-only) | The total number of paged query results. |
PagedData.pageRanges | query.PageRange[] | An array of page ranges for the set of paged query results. |
PagedData.pageSize | number (read-only) | The number of query result rows per page. |
Example Usage
To use the PagedData object effectively, you can set up a paginated query as follows:
1var myCustomerQuery = query.create({2 type: query.Type.CUSTOMER3});4myCustomerQuery.columns = [5 myCustomerQuery.createColumn({ fieldId: 'entityid' }),6 myCustomerQuery.createColumn({ fieldId: 'firstname' }),7 myCustomerQuery.createColumn({ fieldId: 'email' })8];9var myPagedResults = myCustomerQuery.runPaged({ pageSize: 10 });10 11// Fetch results using an iterator12var iterator = myPagedResults.iterator();13iterator.each(function(resultPage) {14 var currentPage = resultPage.value;15 var currentPagedData = currentPage.pagedData;16 log.debug(currentPage.pageRange.size);17 return true;18});In this example, a customer query is defined, executed, and results are iterated using the iterator() method of the PagedData object.
Who This Affects
This information is crucial for:
- Developers: Who need to handle paged data efficiently in their scripts.
- Administrators: Overseeing data management processes that involve paged queries.
Key Takeaways
- The PagedData object is vital for managing large datasets in SuiteScript 2.0.
- It includes methods for synchronous and asynchronous data retrieval.
- The object supports read-only properties for understanding query results.
Source: This article is based on Oracle's official NetSuite documentation.
Frequently Asked Questions (4)
How do I create a PagedData object in SuiteScript 2.0?
What is the maximum number of query results returned per page in PagedData?
Can I use the PagedData methods in both client and server scripts in SuiteScript 2.0?
What does the PagedData count property represent?
Was this article helpful?
More in Integration
- Natural Language Queries in NetSuite AI
MCP Standard Tools SuiteApp enables AI-driven data tasks in NetSuite, aligned with role permissions.
- Square Connector Integration in NetSuite 2026.1
Discover the Square Connector for seamless integration with NetSuite 2026.1, synchronizing transactions, orders, and inventory effortlessly.
- SuiteTalk Web Services Updates for NetSuite Integrations
SuiteTalk Web Services adds new Item Supply Plan support, enhancing integrations for efficient data management.
- SuiteTalk Web Services Enhancements in NetSuite
Explore the latest enhancements to SuiteTalk Web Services, improving integration and API functionalities in NetSuite.
Advertising
Reach Integration Professionals
Put your product in front of NetSuite experts who work with Integration every day.
Sponsor This Category