Event aquery_primarykeys_after

This event can be used to define the key for the query facet. If the representation is linked to a persistent class, the components of the primary keys are already set and can be changed.

If the class is an interface class, the fields list used by an Order By sentence must be filled.

Available variables

  • No current instance is defined. this is not available.
  • The tables that are read when the request is done on a query facet are in a Link abbreviated with [LNK_], but the columns are present in the class [F:abbrev] (where abbrev is the abbreviation used to declare the table in the class definition).
  • The ASTDKEY variable contains the list of fields used for the query order. If more than one field is present, the separator is the semi-column character.

Example

# Here this sub-program has been written for an interface key (the abbreviation is [LNK_])
# If not filled, nothing will happen (there is no default value here)
$STDKEY_QUERY 
  ASTDKEY = "[LNK_]VOLUME;[LNK_]FULLNAME"
Return
# Second example: use another key instead of the default one on a persistent class
# The default value is "[ADP]CHAPITRE;[ADP]PARAM"
$CHANGE_KEY 
  ASTDKEY = "[ADP]PARAM"
Return