SuiteQL.query

Note:

The content in this help topic pertains to SuiteScript 2.0.

Property Description

The string representation of the SuiteQL query.

This string can contain the following types of elements:

  • SQL clauses, such as SELECT, FROM, and WHERE

  • Record or table names, such as customer

  • Field names using dot notation, such as customer.entityid

  • Operators for conditions, such as = and >=

  • Formatting characters, such as newline characters (\n)

This string can also contain field formatting metadata, such as /*{entityid#RAW}*/. When you use Query.toSuiteQL() to convert a constructed query to its SuiteQL query equivalent, metadata may be added to the query string to indicate the formatting (or context) of fields in the query. For example, /*{entityid#RAW}*/ metadata indicates that the entityid field is formatted using the query.FieldContext.RAW field context from the query.FieldContext enum. This metadata is added as comments (using /* and */) and does not affect query execution or the query results.

Type

string (read-only)

Module

N/query Module

Parent Object

query.SuiteQL

Sibling Object Members

SuiteQL Object Members

Since

2020.1

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 theQuery = mySuiteQLQuery.query;
...
// Add additional code 

          

Related Topics

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

General Notices