Query task

A Query task retrieves the list of records found by a query. The result list can be used by another task.

The Query and the Retrieve Records workflow tasks are similar in that the essential purpose of both workflow tasks is to find records. They differ in the way that they find records. A Query workflow task runs a query and uses the records returned by the query. The Retrieve Records task does not use queries. Instead it finds records through their association with a record already associated with a workflow task.

Note: In memory smart object (IMSO) records will not be found with either a Retrieve Records task or Query task. Since IMSO records appear in memory only, they do not reside in the database. Although IMSO records can be used in the Right Side Data section of the Task Filter window, IMSO records will not be returned in the result set from a Retrieve Records task or Query task.

When a query is set to Active Project and run from the Report Manager, the results depend on whether or not the record is in a capital project. If the record is in a capital project, the results are based on the scope of the project the user is in. If the record is not in a capital project, the results are based on the scope of the project the parent record is in. When the same query is run in a workflow, the results are based on all projects, including the Company Level. To ensure that a query run in a workflow returns the same results as that query returns when run from the Report Manager, use a Set Project task at the start of the workflow.

Note: The Random Result Count may remove sorting and may or may not return the same results in the subset from run to run. This feature is meant to be used with workflows to limit the number of records returned in the Query task.
The properties form for a Query task is organized into four sections. Here are descriptions of the fields in the first section:
Label
This is the caption used to identify this task. The text in this field will be used as the caption for the shape in the drawing that represents this workflow task. Use the standards in Workflow naming conventions.
Description
A description of this task goes in this field.
Query, Query Object Type

Clicking the Query link causes a window to pop up that allows you to select the query that this task will run. The name of the selected query appears in a read-only field to the right of the Query link. The object type of the selected query appears in a read-only field to the right of the Query Object Type link.

The window that pops up to select the query looks like the following figure. Select the module of the query you want from the drop-down list to the right of the Module label.
Figure 1. Select Item(s) panel showing queries
The image is explained in the text.

If what you are looking for is not a query, but some other kind of report, you will not see what you are looking for because the list initially includes only queries. You will need to select the type of report you want to see it.

To select the type of report you want to see, click the filter icon to the right of the Reports List label. A menu will pop up that looks like the following figure. From this menu, you can choose the type of report you want to see a list of or you can choose the All menu item to see a list that contains every kind of report.
Figure 2. Report Type menu
The image is explained in the text.
Query Security Enabled
To enable the security group settings of the logged-in user on records retrieved by the Query task, select the Query Security Enabled check box.

Some queries have filter values that can be specified interactively ($$RUNTIME$$ filters). A Query task does not have any way to provide a value for interactive filters. However, a Query task has other filtering mechanisms that it can use. The purpose of the other sections of a Query task's properties are to control the filtering of query results.