Modules

filter

 

Objects/Functions

module (N/query)

SuiteScript 2.0

Query.toSuiteQL()

// Please search https://system.netsuite.com/app/help/helpcenter.nl?search=Query.toSuiteQL() for more information.

N/query Module
Query.toSuiteQL()
Method Description: Converts this query.Query object to its corresponding SuiteQL representation. This method returns a query.SuiteQL object that represents the same query as the original query.Query object. This object includes the SuiteQL.columns, SuiteQL.params, SuiteQL.query, and SuiteQL.type properties. You can run the query using SuiteQL.run(), or you can run the query as a paged query using SuiteQL.runPaged(options). The resulting SuiteQL query string (contained in the SuiteQL.query property) does not include any aliases you set on query result columns in the original query.Query object. For more information about aliases, see Column.alias. 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.SuiteQL
Supported Script Types: Client and server scripts For more information, see SuiteScript 2.0 Script Types.
Governance: None
Module: N/query Module
Parent Object: query.Query
Sibling Object Members: Query Object Members
Since: 2020.1
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=Query.toSuiteQL()

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_157960522744.html