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.
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.
- 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 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 - 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.