Create Smart Query Definitions from Ad-hoc Queries

After you create an ad-hoc query, you can create a smart query definition A smart query definition is a previously defined query you use to generate results for parameters you specify. They are typically created to perform complex calculations that use business logic. from the results. You can then create new smart query instances and base them on the definition. For information about smart queries, refer to Smart Queries.

When you create the definition, all the output fields from the ad-hoc query are available so you can specify whether to include them in the output of smart query instances created from this definition. You can also specify the fields to include as filter options, their filter operators, and the record type to use as the source view.

The filter fields you select appear on the Parameters tab when you create smart query instances from this definition. For example, if you include Account Number with a filter operator of Not Equal To, the Parameters tab displays an Account Number not equal to field. You can specify which parameter this number should not equal in the query results.

We recommend you include a system record ID as an output field in the ad-hoc query you use to create the definition so query instances created from it can uniquely identify records that appear in the results. For example, for a revenue view smart query, include the Revenue record field.

Note: If the ad-hoc query on which you based your smart query definition changes, the change does not appear in the smart query. You must update the smart query separately.