SuiteQL.params

Note:

The content in this help topic pertains to SuiteScript 2.0.

Property Description

The parameters for the query.

In SuiteQL, query conditions are represented using the WHERE clause and a set of parameters. In a SuiteQL string, parameter values for conditions are represented using question marks (?), and the params property includes a list of the parameter values to use when the query runs. If the query uses more than one parameter, the order of the values in the params property matches the order the parameters appear in the query string.

For example, consider the following query.Condition object in a query for customer records:

                    myQueryObject.createCondition({ fieldId: 'creditlimit', operator: query.Operator.LESS_OR_EQUAL, values: [50000]
}); 

                  

If you use Query.toSuiteQL() to convert this query to SuiteQL, the resulting SuiteQL query string includes the following WHERE clause:

                    WHERE customer.creditlimit <= ? 

                  

In the resulting query.SuiteQL object, the params property includes the value 50000.

Type

Array<string | number | boolean> (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 theParams = mySuiteQLQuery.params;
...
// Add additional code 

          

Related Topics

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

General Notices