Creating a Query
A query is a container entity that comprises filter conditions. The created query can be displayed as a value that can be selected in lookup fields.
When you save a query after typing its name and selecting its base entity, you can define conditions in the Query Condition tab.
Use one of the following options to create a query.

The following steps enable you to define the query logic which will be used for shortlisting the records.

-
Click Create/Edit Query to view the Advanced Find page.
- Without making any changes, click
and then specify conditions that align with logic that you want to define.
- Click Save and close the dialog.
XML details of the query will be listed in the Query XML area. - If required:
- Modify the XML conditions in this area,
- Ensure that modifications are error free, and then click Save.

-
Click Create/Edit Query to view the Query Editor page.
Note: Do not change the default view, Temp_<view name>, that is populated by default in the Query Editor page. -
Click the Edit Filters button.
-
Configure the filter conditions that align with the logic to shortlist the records.
-
Click the Apply button.
-
Click the drop-down next to the view name and select Save changes to current view.
-
Close the dialog.
XML details of the query will be listed in the Query XML area.
-
If required, modify the displayed XML conditions and then click Save. Ensure that manual modifications to the XML conditions are error-free.

The following steps enable you to use an existing view that contains applicable logic.
-
Click Use Existing View.
-
From the list, select the view and then click Use Query.
Note:
-
The drop-down list displays the default system views and personal views created by the logged in user.
-
The Nearby Contact query filters saved by the logged-in user, will not be available for selection in this drop-down list.
Conditions defined in the view will be displayed in the Query XML area.
-
- If required, modify the displayed XML conditions and then click Save. Ensure that manual modifications to the XML conditions are error-free.
The query framework is based on functionality available in the Advanced Find dialog. For details on working in the Advanced Find dialog, see Microsoft documentation.

The Query Condition Group and Query Condition entities are no longer displayed in the sitemap. To enable the continued use of conditions in records of these entities, it's recommended to migrate filter logic to the Advanced Find dialog.
- View the Query record.
- From the Query Condition Group and Query Condition sub-grids, view the records preferably in unique browser tabs. It will be easier to copy logic to the Advanced Find dialog.
- In the Query Condition tab of the Query record, click Create/Edit Query. The Advanced Find dialog will be displayed.
- Create filter conditions identical to conditions in the displayed Query Condition Group and Query Condition records.
- Save the conditions in the Advanced Find dialog and then save the Query record.
Logic defined in the Query Condition Group and Query Condition records will no longer be used. Instead, when the query runs, the newly created conditions displayed in the Query Condition tab will be executed.
Notes:
The following scenarios can occur in the Query, Query Condition Group and Query Condition entities:
- When the Query record does not include any Query Condition Group and Query Condition records in sub-grids.
While the following buttons will be enabled, the user is restricted from associating records:- In the Query Condition sub-grid: Add Existing Query Condition, New Query Condition
- In the Query Condition Group sub-grid: Add Existing Query Condition Group, New Query Condition Group.
- When the Query record includes one or more Query Conditions or Query Condition Group records in sub-grids:
The sub-grids can be updated with existing or new Query Condition and Query Condition Group records. Similarly, when you view a Query Condition or Query Condition Group record from within a Query record, the following behavior occurs:
In the Query Condition record, you can associate:- A new Query Condition Group record or update the currently associated Query Condition Group.
- A new Query or update the currently associated Query.
- A new Query Condition or update the currently associated Query Condition record.
- A new Query or update the currently associated Query.