Filter Statements

To determine what data is retrieved when you run action views, you need to create filter statements using 'and' and 'or' logic combined with selected fields.

Different types of filter statements include selection rules, sign reversal rules, column filters, and joins (dataviews).

The components that make up filter statements are represented by the following containers:

And container Use the And container for fields that are required (fields separated by 'and' operators).
Or container

Use the Or container for two or more fields, where at least one field is required (fields separated by 'or' operators).

Field container

Use the Field container to define the fields within your And and Or containers.

For example, to retrieve all sales invoices with a due date during the current year and an account name that starts with an M or an N, you would use the following filter statement:

Example Filter Statement
Field container And container Field container Or container Field container
Sales Invoice Due Date = This Year AND Account Name starts with M OR Account Name starts with N

To build the filter statement, you drag and drop the required containers into the drop zone and set the criteria for each field.

Drag and drop containers into the drop zone

Color coding helps identify which containers can be dragged into a drop zone. You cannot drag a container into the drop zone if it is the same color as that drop zone. By default, the initial drop zone is an 'and' operator which means you cannot drag an And container into the initial drop zone.

Note:

If you want to begin a filter statement with an 'or' operator, you need to drag an Or container into the initial drop zone.

Building Filter Statements

Use the And, Or, and Field containers to build filter statements.

To build a filter statement:

  1. Drag and drop a Field container into the drop zone. The initial drop zone is an 'and' operator by default, therefore you cannot drag an And container into it. If you want to change it to an 'or' operator, you need to drag an Or container into the drop zone.
  2. Click the pencil icon on the Field container to open the criteria dialog. You can remove a Field container by clicking the trash can icon.
  3. Define the field and click Apply Selection.
    1. Select a field. The available fields depend on the dataview you are inquiring on.
    2. Select an operator.
    3. Enter a value or select a date from the calendar if the value is a date.
    4. [Optional] Select the checkbox depending on the type of filter statement you are creating.
  4. Add and define additional fields as necessary.
  5. Drag and drop an Or container into the filter statement if you want to use an 'or' operator. A new drop zone is created where you can add and define fields.

Examples

Example 1: Add and define multiple Field containers to the initial drop zone to create a filter statement such as:

Sales Invoice Due Date = This Year AND Account Name starts with M AND Outstanding Value > 1,000.00

Example 2: After adding and defining fields in the 'and' operator drop zone, add an Or container, then add and define fields to create a filter statement such as:

Sales Invoice Due Date = This Year AND Account Name starts with M OR Account Name starts with N

Example 3: Start your filter statement with an 'or' operator by dragging and dropping an Or container into the initial drop zone before adding and defining fields to create a filter statement such as:

Sales Invoice Due Date = This Year OR Sales Invoice Due Date = Next Year

Filter Statement Prompts

For some filter statements, you can set criteria to prompt you to enter the values at runtime rather than setting them on the action view template.

When a criterion is set to prompt you at runtime, the field appears orange in the filter statement and you can provide or modify the value when you run the action view. For example:

Sales Invoice Due Date = This Year set to Prompt

To set a criterion to prompt you for its value at runtime, select the Prompt checkbox in the criteria dialog for the field.

Supplying Date Values

When a criterion is a date field, you can enter either a precise date (hard date), or an offset of the current date (soft date). Salesforce refers to soft dates as "relative date values".

Action Views supports the following relative date values: Today, Tomorrow, Yesterday, Last "n" Days, Next "n" Days, This Week, Last Week, Next Week, This Year, Last Year, Next Year.

See the Salesforce Help for details of how these relative date values are resolved.