Event aquery_decode_criteria_after

This event is used for representations, when a query facet is requested. It allows the development partner to add properties to the columns that can be criteria for the query in the &where=... filtering option.

  • If the class is persistent, the columns are already defined, but they can be completed or changed.
  • If the class is an Interface type, no table description is filled. The development partner must fill the parameters.

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).
  • NBPRO is the variable defining the number of properties present in the query facet.
  • TPPTH is an array containing the properties present by default in the query facet.
  • TBPRO is an array containing the alias associated with the properties present by default in the query facet.
  • TBFIL is an array containing the column name in the table that fills the query facet.
  • TBTYP is an array containing the data types of the properties present by default in the query facet. The different values available for TBTYP are the following:
1 TinyInt
2 Shortint
3 Integer
4 Decimal
5 Float
6 Double
7 Char
8 Date
9 Blbfile
10 Clbfile
11 Uuident
12 Datetime
25 Translatable text stored in ATEXTE (data type ATX)
26 Translatable text stored in ATEXTRA (data types AXX, AX1, AX2, AX3)

Example

# This piece of code has to be called by Gosub on the AQUERY_DECODE_CRITERIA_AFTER event
# Here, the class managed is an interface class
# So the "pseudo table" has directly been declared with [LNK_] abbreviation.
$ FILL_CRITERIA
  NBPRO += 1 
  TBPRO(NBPRO) = "VOLUME"
  TBTYP(NBPRO) = 7 
  TBPTH(NBPRO) = "AVOLFIL.VOLUME"
  TBFIL(NBPRO) = "[LNK_]VOLUME"
  NBPRO += 1 
  TBPRO(NBPRO) = " FULLNAME"
  TBTYP(NBPRO) = 7 
  TBPTH(NBPRO) = "AVOLFIL.FULLNAME"
  TBFIL(NBPRO) = "[LNK_]FULLNAME"
  Return