Metadata (ViewMetadata)
The ViewMetadata node on a view contains the embedded query definition that drives the view's data sources, joins, ranges, and sort orders. It is an AxQuerySimple object — the same type used by standalone AOT queries — but defined inline within the view rather than as a separate AOT element.
If the view's Query property references a standalone AOT Query, the ViewMetadata is populated from that query automatically. If no external query is referenced, the ViewMetadata is where developers define data sources manually.
The embedded query structure is identical to a standalone AOT query. This page covers the properties specific to the ViewMetadata context. Comprehensive coverage of query objects — including data sources, ranges, relations, grouping, ordering, and union queries — is available on the dedicated Queries page.
Structure Overview
The ViewMetadata follows this hierarchy:
ViewMetadata (AxQuerySimple)
└── DataSources (AxQuerySimpleRootDataSource)
├── Fields (AxQuerySimpleDataSourceField)
├── Ranges (AxQuerySimpleDataSourceRange)
├── GroupBy (AxQuerySimpleGroupByField)
├── Having (AxQuerySimpleHavingPredicate)
├── OrderBy (AxQuerySimpleOrderByField)
└── DataSources (AxQuerySimpleEmbeddedDataSource) ← nested/joined data sources
├── Fields
├── Ranges
└── DataSources ← further nesting for multi-table joins
The root data source is the primary table the view reads from. Additional tables are added as embedded data sources nested underneath, each with a JoinMode that controls how records are combined.
Data Sources
Root Data Source
The root data source (AxQuerySimpleRootDataSource) identifies the primary table and supports additional clauses for grouping, ordering, and having.
Embedded Data Sources
Each embedded data source (AxQuerySimpleEmbeddedDataSource) represents a joined table. Key properties:
| Property | Type | Description |
|---|---|---|
| JoinMode | JoinMode_ITxt | How the data source joins to its parent. Values: InnerJoin (0), OuterJoin (1), ExistsJoin (2), NoExistsJoin (3). |
| FetchMode | FetchMode_ITxt | How linked records are fetched. Values: OneToOne (0), OneToN (1). |
| UseRelations | NoYes | Whether to use AOT-defined relations for the join condition. Values: No (0), Yes (1). |
When UseRelations is Yes, the join condition is derived from the relations defined between the tables in the AOT. When No, custom relations are defined inline under the data source's Relations node.
Embedded data sources can be nested to any depth, enabling multi-table join chains.
Properties
| Property | Display Name | Type | Description |
|---|---|---|---|
| QueryAxQuerySimple | |||
| QueryType | Query Type | QueryType | Type of query. Values: Join (0), Union (1). |
| Title | Title | String | Title of the query. |
| Description | Description | String | Descriptive help text for the query. |
| Form | Form | String | Form associated with the query. |
| UserUpdate | User Update | NoYes | Whether the user may modify the query. Values: No (0), Yes (1). |
| Literals | Literals | SqlLiteralMode_ITxt | How literals are represented in SQL statements. Values: Default (0), ForceLiterals (1), ForcePlaceholders (2). |
| Interactive | Interactive | NoYes | Whether the query may open dialogs. Values: No (0), Yes (1). |
| AllowCheck | Allow Check | NoYes | Whether security checking occurs before or after the form opens. Values: No (0), Yes (1). |
| Searchable | Searchable | NoYes | Whether query results are searchable. Values: No (0), Yes (1). |
| AllowCrossCompany | Allow Cross Company | NoYes | Whether the query aggregates data across all companies. Values: No (0), Yes (1). |
| Importable | Importable | NoYes | Whether the query is importable. Values: No (0), Yes (1). |
| Data SourceAxQuerySimpleDataSource | |||
| Name | Name | String | The name of the data source. |
| Tags | Tags | String | Tags for this element separated by semicolon. |
| Table | Table | String | The table, view, or data entity that supplies data for this data source. |
| Label | Label | String | Descriptive label for the data source. |
| Company | Company | String | Specific company context for this data source. |
| FirstOnly | First Only | NoYes | Whether only the first record should be selected. Values: No (0), Yes (1). |
| FirstFast | First Fast | NoYes | Whether to retrieve the first record faster than subsequent records. Values: No (0), Yes (1). |
| AllowAdd | Allow Add | NoYes | Whether the user may add fields for search. Values: No (0), Yes (1). |
| Update | Update | NoYes | Whether the cursor can update records. Values: No (0), Yes (1). |
| Enabled | Enabled | NoYes | Whether the data source is enabled. Values: No (0), Yes (1). |
| SelectWithRepeatableRead | Select With Repeatable Read | NoYes | Whether the data source uses a repeatable read hint. Values: No (0), Yes (1). |
| ConcurrencyModel | Concurrency Model | ConcurrencyModel | Concurrency model for the data source. Values: Auto (0), Optimistic (1), Pessimistic (2). |
| UnionType | Union Type | UnionType | Type of union for this data source. Values: None (0), Union (1), UnionAll (2). |
| DynamicFields | Dynamic Fields | QueryFieldListDynamic | Whether fields are dynamically selected. Values: No (0), Yes (1), Unselected (99). |
| PolicyContext | Policy Context | String | Policy context for the data source. |
| IsReadOnly | Is Read Only | NoYes | Whether the data source is read-only. Values: No (0), Yes (1). |
| ApplyDateFilter | Apply Date Filter | NoYes | Whether the data source is filtered for date effectivity. Values: No (0), Yes (1). |
| ValidTimeStateUpdate | Valid Time State Update | ValidTimeStateUpdate | Type of update for date-effective records. Values: CreateNewTimePeriod (1), Correction (2), EffectiveBased (3). |
| ChangeTrackingEnabled | Change Tracking Enabled | NoYes | Whether the data source participates in change tracking. Values: No (0), Yes (1). |
| Embedded Data SourceAxQuerySimpleEmbeddedDataSource | |||
| JoinMode | Join Mode | JoinMode_ITxt | How the data source joins to its parent. Values: InnerJoin (0), OuterJoin (1), ExistsJoin (2), NoExistsJoin (3). |
| FetchMode | Fetch Mode | FetchMode_ITxt | How linked records are fetched. Values: OneToOne (0), OneToN (1). |
| UseRelations | Use Relations | NoYes | Whether to use AOT-defined relations for the join condition. Values: No (0), Yes (1). |