How to configure an activity to run a list view report using parameters as selection criteria
Summary
You can configure an activity to run a list view report where the selection criteria (defined on the Content tab) depend on the value of parameters defined in the Parameters tab.
For example, your activity can accept a positive integer representing a number of days as its input parameter. The activity can compute two list view parameters, StartDate and EndDate, where StartDate is today and EndDate is today minus the number of days parameter value.
The report can select and display those work objects in the current application that were created between the computed start date and end date parameter values.
This article describes how to configure the activity and send parameters to the list view rule.
Suggested Approach
- Create a new activity.
- Enter a name for the activity.
- Click Create.
- On the Steps tab in the first step, enter a description and, in the Method field,
Property-Set
. Then identify parameters using the notationParam.paramname
. In the example, a range of dates is specified, along with the key parts of the list view rule. The final parameter is set to refresh or display the output.
- In the second step, enter a description and, in the Method field,
Call Rule-Obj-ListView.ShowView
. (If you only want to retrieve and sort the data, leaving it on the clipboard but not displaying it in a web page, you can use the Obj-List-View method rather than call the ShowView activity.)
- Enable the Pass current parameter page option. This will pass the parameters that you specified in Step 1 to the list view.
- In the example, the user is prompted to enter the number of days to search for work objects. Typically, this value is passed to the activity as a parameter. For purposes of this example, the default value has been set to 30 to demonstrate the feature.
- Save the activity rule.
- Create a list view rule. Set with the Applies To key part, Purpose key part, and Owner key part you selected as the ViewClass, ViewPurpose and ViewOwner parameter values. Specify the content and display fields as desired..
- On the Content tab, enter an identifier for the row in the Label field.
- In the Field field, select a property that you want to compare against from the SmartPrompt list.
- Choose a condition from the drop-down list.
- In the Value field, enter the text "param.", then choose a parameter to use as the selection criteria from the SmartPrompt list. In the example, the parameters are StartDate and EndDate, specified in the activity you just created.
- Open the Parameters tab.
- In the Name fields, enter StartDate and EndDate.
- In the Data Type field for each parameter, select String from the drop down list.
- Save the List View form.
- Open the activity.
- Click the Run toolbar button . The report displays according to the criteria you specified. In the example, the report shows objects created in the last 30 days.
Related Topics
Comparing the Obj-List-View, Obj-Browse and Obj-List methods