Filtering Rows in a Standard Query Facet

This document provides information on how to filter rows in a standard Query facet.

The process described below demonstrates how to use a standard Query facet as the basis for an enhanced Query facet that can filter the data contained in the rows:

  1. Link the "lookup" for one or more properties to a standard representation class.
    Refer to Modifying the selections (Query facet) for a standard data table.
    Note: A default filter can be added directly to the representation class. This should be considered when the filter condition is simple. Follow steps 2 and 3 for complex filters.
  2. In the Scripts block of the General tab, add script [data type code]_RSTD. Make sure you choose the appropriate script code that uses "AQUERY…" events to extend the filter criteria (AQUERY_CRITERIA_AFTER) and amend and/or populate each row values. For example:
    $METHODSCase CURPTHWhen ""Case ACTIONWhen "AQUERY_CRITERIA_AFTER" : Gosub AQUERY_CRITERIA_AFTEREndcaseEndcaseReturn

     $AQUERY_CRITERIA_AFTERIf (PQRY.QWHERE <> "")PQRY.QWHERE = "(" + PQRY.QWHERE + ") and PROPERTY eq '" + VALUE + "'"ElsePQRY.QWHERE = "PROPERTY eq '" + VALUE + "'"EndifReturn
  3. Perform a global validation on your representation class before it can be used in Sage X3. It should validate:
  4. Click Options > Global validation on the right-hand panel of the representation class to perform a global validation.

Completed result