The GXquery service layer, known as API, includes all the data types that allow the developer to interact with GXquery at runtime through script code. One of these data types is described below.
Queries can receive parameters and these can be sent (or not) to the query. Is natural that the developer ask to end user for new values with purposes of display new scenarios from the same information. Then, this data type offers this posibility.
Properties
Name |
Is the parameter name. |
Description |
Is the parameter description. |
Type |
Indicates the data type of the parameter, that could be:
-
Integer
-
Real
-
Character
-
Date
-
DateTime
-
Boolean
|
IsCollection |
Indicates if a parameter is a collection. |
Value |
Contains the parameter default value as defined in the query and can be overwrited by another one. |
Example
In this example lets to load a combo box with the parameters of the previously selected query.
&ParameterName.Clear()
For &GXqueryParameter in &GXqueryQueryInfo.Parameters
&ParameterName.AddItem(&GXqueryParameter.Name, Iif(&GXqueryParameter.Description <> "", &GXqueryParameter.Description, &GXqueryParameter.Name))
EndFor
The &GXqueryParameter variable is based in the GXqueryParameter data type. After the &ParameterName combo box is loaded can be examined by the end user to know the values that the query will consider.
Another example is ask to the end user new values for the query. in this case, after the input, we need write code to load the GXqueryRuntimeParameters variable with those new values. This values does not overwrite the default values of the query.
If no values are passed, the query take into account its default values.
See also
GXqueryRuntimeParameter data type