Adding a filter to a query

You can use filters to add selection criteria to your queries. These filters correspond to WHERE clauses in the SQL.

Note: You can also use filter codes in Infor Operations and Regulations to filter the data that is displayed in the mobile app. See "Agency Personalization" in the Infor Operations and Regulations User and Administration Library for more information about filter codes.

However, there is a limitation. Any filter codes that you define for code definition fields will not be applied in the mobile app.

  1. Open the Mobile configuration in the Configuration Editor and browse to the query to which you want to add a filter.
  2. Add a child Filter node to the query's Filters node.
  3. Add these attributes to the new filter node:
    ID
    Specify a unique ID for the filter.
    DisplayName
    Specify a display name for the filter. This is the name that is displayed in the mobile app.
    Predicate
    Enter the SQL for the filter. If the SQL for the parent query includes a @FILTERS token, the filters you define will be inserted at the location of the token. Otherwise the filters are added to the end of the SQL statement.

    The syntax of the predicate depends on the parent SQL. For example, the SQL for the MyBuildingInspections query ends with a WHERE clause, as shown below.

    WHERE UPPER(BLDGINSP.RESULT) = ' '
    AND APBLDGINSPKEY <> 1
    AND UPPER(BLDGINSP.ASSIGNTO) = UPPER(@EMPID)

    This query has two filters. The SQL does not include a @FILTERS token, so the filters will be added to the end of the SQL. Because the SQL already includes a WHERE clause, the predicate for each filter is an AND statement. The predicate of the Scheduled filter is shown in this example:

    AND BLDGINSP.SCHEDDTTM IS NOT NULL