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.
GXqueryMetadata data type is used to recover information about metadatas, such as its Id, name, and status.
Properties
Id |
Is the metadata Id. |
Name |
Is the metadata name. |
Status |
The metadatas has some states to indicate if they are available or not. They are:
-
Loading. Is when the metadata is being imported or impacted.
-
Started. Is when the metadata has been initiated and is ready to work.
-
Stopped. Is when the metadata has been stopped for import/export purposes.
-
Load failed. Is when the load of metadata has failed.
-
Exporting. Is when the metadata is being exported.
|
Example
In this example, the developer needs to load a dynamic combo box with the metadata's names to be displayed in the screen.
Sub 'GetMetadatas'
&GXqueryMetadatas = &GXquerySession.GetMetadatas(&Errors)
If &Errors.Count > 0
Msg(&Errors.Item(1).Message)
Else
&MetadataName.Clear()
For &GXqueryMetadata in &GXqueryMetadatas
&MetadataName.AddItem(&GXqueryMetadata.Name)
EndFor
&MetadataName = &GXqueryMetadata.Name
EndIf
Endsub
The dynamic combo box is loaded with the names of the metadatas associated with the repository where the used started a session. After Else scope, the &MetadataName dynamic combo box variable is cleared. The For command iterate over &GXqueryMetadatas collection and loads the combo box.