Modules

filter

 

Objects/Functions

module (N/query)

SuiteScript 2.0

query.runSuiteQL(options)

{query}.runSuiteQL({query: {string*},params: {Array}})

N/query Module
query.runSuiteQL()
Method Description: Runs an arbitrary SuiteQL 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 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. 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.ResultSet
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.runSuiteQL(options)

Example:

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

// Code Example 2
// In this example, mySuiteQLCustomerQuery is an existing SuiteQL object
var results = query.runSuiteQL(mySuiteQLCustomerQuery);

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

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

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