Modules

filter

 

Objects/Functions

module (N/query)

SuiteScript 2.0

query.runSuiteQLPaged(options)

{query}.runSuiteQLPaged({query: {string*},params: {Array},pageSize: {number}})

N/query Module
query.runSuiteQLPaged()
Method Description: Runs an arbitrary SuiteQL query as a paged query. SuiteQL is a query language based on the SQL-92 revision of the SQL database query language. It provides advanced query capabilities you can use to access your NetSuite records and data. You can specify the SuiteQL query as one of the following: A string representation of the SuiteQL query A query.SuiteQL object Although this approach is supported, you should create a query.SuiteQL object and call SuiteQL.runPaged(options), if possible, to run a paged SuiteQL query. A JavaScript Object that contains a query property and, optionally, a params property 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.0 Script Types.
Governance: 10 units
Module: N/query Module
Sibling Module Members: N/query Module Members
Since: 2020.1
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=query.runSuiteQLPaged(options)

Example:

// Code Example 1
var results = query.runSuiteQLPaged({
query: 'SELECT customer.entityid, customer.email FROM customer',
pageSize: 10
});

// Code Example 2
// To use this approach, you must load the N/util module in your script
// In this example, mySuiteQLCustomerQuery is an existing SuiteQL object
var pageSizeObject = {
pageSize: 10
};
var results = query.runSuiteQL(util.extend(mySuiteQLCustomerQuery, pageSizeObject));

// Code Example 3
var results = query.runSuiteQL({
query: 'SELECT customer.entityid, customer.email FROM customer WHERE customer.isperson = ?',
params: [true],
pageSize: 10
});

// Code Example 4
// Add additional code
//...
var results = query.runSuiteQLPaged({
query: 'SELECT customer.entityid, customer.email FROM customer WHERE customer.isperson = ?',
params: [true],
pageSize: 20
});
//...
// Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_157960586441.html