SuiteQL.runPaged(options)

Note:

The content in this help topic pertains to SuiteScript 2.0.

Important:

You must specify a sorting order in the query 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 SuiteQL query as a paged query and returns the paged query results.

You can use this method to run the SuiteQL query and obtain the results as a query.PagedData object. If you want to run the SuiteQL query as a non-paged query, use SuiteQL.run().

Note:

If the SuiteAnalytics Connect feature is enabled in your NetSuite account, there is no limit to the number of results this method can return. If the SuiteAnalytics Connect feature is not enabled, this method can return a maximum of 100,000 results across all pages in the result set. For more information about SuiteAnalytics Connect, see SuiteAnalytics Connect.

For more information and examples of using SuiteQL in the N/query module, see SuiteQL in the N/query Module. For more information about SuiteQL in general, see SuiteQL.

Returns

query.PagedData

Supported Script Types

Client and server scripts

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

Governance

10 units

Module

N/query Module

Parent Object

query.SuiteQL

Sibling Object Members

SuiteQL Object Members

Since

2020.1

Parameters

Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

options.pageSize

number

optional

The size of each page in the query results. The default value is 50 results per page. The minimum page size is 5 results per page, and the maximum page size is 1000 results per page.

options.customScriptId

string

optional

A unique identifier used for potential performance issues in a query.

If your query produces performance issues, the custom script ID identifies where the update will need to occur.

This ID can also be used as a precaution to speed up performance fixes, if necessary.

Note:

The Script ID must be unique or the performance enhancements will affect each query with the same customScriptID.

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
...
// myQuery is an existing query.Query object
var mySuiteQLQuery = myQuery.toSuiteQL(); var results = mySuiteQLQuery.runPaged({ pageSize: 20, customScriptId: 'myCustomScriptId'
});
...
// Add additional code 

          

Related Topics

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

General Notices