Adding Columns to a Standard Query Facet

This document provides information on how to add columns to 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 includes the original and additional columns.

  1. Link the "lookup" of one or more properties to a standard representation class.
    Refer to Modifying the selections Query facet for a standard table for more information.
  2. If you need to add standard columns from the original data table, go to the Displayed Properties tab and add the properties you need to include in the Query facet.
    Select the Query check box for each new property, and set the Initial status field to "Visible".
  3. If you need to add columns that do not exist in the original data table:
    1. In the Properties block of the Properties tab, add the properties you need to include in the Query facet.
    2. In the Displayed Properties tab, add the properties you added in the Properties tab.
      Select the Query check box for each new property, and set the Initial status field to "Visible".
    3. In the Scripts block of the General tab, add script [data type code]_RSTD to populate the column values in the Query facet.
      For example, you can use the following script to add two new columns whose values are defined in a local menu:
       $METHODSCase CURPTHWhen ""Case ACTIONWhen "AQUERY_TRANS_AFTER : Gosub AQUERY_TRANS_AFTEREndcaseEndcaseReturn$AQUERY_TRANS_AFTERLocal Char PROPERTY1(30), PROPERTY2(30)If (PROPERTY1 <> "" & PROPERTY1 <> "1") # ignore blank and first '- Select -' optionthis.PROPERTY1 = mess(val(PROPERTY1), [local menu code], 1)Elsethis.PROPERTY1 = ""EndifIf (PROPERTY2 <> "" & PROPERTY2 <> "1") # ignore blank and first '- Select -' optionthis.PROPERTY2 = mess(val(PROPERTY2), [local menu code], 1)Elsethis.PROPERTY2 = ""EndifReturn
  4. Perform a global validation on your representation class before it can be used in Sage X3. It should validate:
  5. Click Options > Global validation on the right-hand panel of the representation class to perform a global validation.

Completed result