Modules

filter

 

Objects/Functions

module (N/query)

SuiteScript 2.0

query.SuiteQL

// Please search https://system.netsuite.com/app/help/helpcenter.nl?search=query.SuiteQL for more information.

N/query Module
query.SuiteQL
Object Description: A 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. Use Query.toSuiteQL() to create this object. This method converts an existing query.Query object to its corresponding SuiteQL representation as a query.SuiteQL object. You can use SuiteQL.run() to run the query and obtain the results as a query.ResultSet object. You can also use SuiteQL.runPaged(options) to run the query as a paged query and obtain the results as a query.PagedData object. When you convert a query.Query object to a query.SuiteQL object, the resulting SuiteQL query is the same as the original query. It includes the same query result columns, sort order, and conditions that were set on the original query. When you run the resulting SuiteQL query using SuiteQL.run() or SuiteQL.runPaged(options), you receive the same results as you would if you ran the original query using Query.run() or Query.runPaged(). 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.
Supported Script Types: Client and server scripts For more information, see SuiteScript 2.0 Script Types.
Module: N/query Module
Methods and Properties: SuiteQL Object Members
Since: 2020.1
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=query.SuiteQL

Example:

// Code Example 1
// Add additional code
//...
// myQuery is an existing query.Query object
var mySuiteQLQuery = myQuery.toSuiteQL();

var results = mySuiteQLQuery.run();
//...
// Add additional code

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