Step 2: Build the Query Condition(s)

  • addQuery() builds a SQL select statement (not seen by the user)
  • Each addQuery() call adds a new "where" clause to the select statement
  • addQuery() calls are automatically AND'ed
var myObj = new GlideRecord('change_request');
myObj.addQuery('category', '=', 'Hardware');
myObj.addQuety('priority', '!=', 1);

The example shown only builds the select statement; it does not execute it.

TIP FROM THE FIELD
In a SQL statement, the "where" clause has a direct effect on how long it takes to return data. Since the query conditions generate a SQL statement, use the appropriate query conditions and the right number of them to generate the correct "where" clause. If you do not use the right query conditions, performance of a query can be degraded.

results matching ""

    No results matching ""