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.
The GXqueryQueryInfo data type is used to know about the query names, the parameters to send to GXquery (its names, descriptions, types. etc.), and the output formats.
Properties
Name |
Is the query name. |
Parameters |
Are the parameters to be sent to GXquery. |
OutputFormats |
Are the different output formats for each query. |
Example
In this example we need to load a pair of combo boxes: one with the all possible output formats of a Query previously choosen and other with the list of parameters to be sent.
To do this, first, the GXqueryqueryinfo variable receives information through of the GetInformation method. Next, with the For command, we load the OutputFormatId combo box after to make a string containing the formats's information.
Now we going to load the second combo box, called ParameterName. To do this we make a string containing information about the parameters for, finally, to load the combo box.
&GXqueryQueryInfo = &GXqueryQuery.GetInformation(&Errors)
&OutputFormatId.Clear()
For &GXqueryOutputFormat in &GXqueryQueryInfo.OutputFormats
&OutputFormatId.AddItem(&GXqueryOutputFormat.Id, Iif(&GXqueryOutputFormat.Title <> "", &GXqueryOutputFormat.Title, &GXqueryOutputFormat.id))
EndFor
&ParameterName.Clear()
For &GXqueryParameter in &GXqueryQueryInfo.Parameters
&StringFieldsParameter = &GXqueryParameter.Name + '/' + &GXqueryParameter.Description + '/' + &GXqueryParameter.Type + '/' + &GXqueryParameter.IsCollection.ToString() + '/' + &GXqueryParameter.Value
&ParameterName.AddItem(&GXqueryParameter.Name, &StringFieldsParameter)
EndFor
See also
GXqueryQuery data type