Query Extensions
A Query Extension (AxQuerySimpleExtension) lets you modify a base AOT query without editing its original definition. Extensions are the standard mechanism for customising queries delivered by Microsoft or other ISVs — they follow the same extension model used for tables, forms, and other AOT objects.
A query extension can:
- Add new data sources — both new root data sources and new embedded (joined) data sources under existing parents.
- Add fields, ranges, relations, and order-by entries — extend the field list, filtering, join conditions, or sort order on existing data sources.
- Modify properties and ranges — change property values on existing elements via property modifications and range modifications.
Query extensions cannot remove existing data sources, fields, or ranges from the base query. They are purely additive, with the ability to modify properties on existing elements.
Extension Naming Convention
Query extension objects follow the naming pattern:
<BaseQueryName>.<ExtensionPackageName>
For example, an extension to the CustTableListPage query in the MyCustomModel package would be named CustTableListPage.MyCustomModel.
What You Can Extend
| Collection | Child Type | Purpose |
|---|---|---|
| RootDataSources | AxQuerySimpleRootDataSource | Add entirely new root-level data sources to the query. |
| DataSources | AxQueryExtensionEmbeddedDataSource | Add new embedded (joined) data sources under an existing data source. |
| Fields | AxQueryExtensionQueryDataSourceField | Add fields to an existing data source's field list. |
| Ranges | AxQueryExtensionQueryDataSourceRange | Add filter ranges to an existing data source. |
| Relations | AxQueryExtensionQueryDataSourceRelation | Add join relations to an existing embedded data source. |
| OrderByFields | AxQueryExtensionQueryOrderByField | Add sort-order entries to an existing root data source. |
| PropertyModifications | AxPropertyModification | Modify property values on existing query elements. |
| RangeModifications | AxExtensionModification | Modify property values on existing ranges. |
Extension Child Elements
Each extension child element wraps a reference to the standard query child type and adds a Parent property that identifies which existing data source the new element should be attached to.
Embedded Data Source (AxQueryExtensionEmbeddedDataSource)
| Property | Display Name | Type | Description |
|---|---|---|---|
| Name | Name | String | The name of the extension data source entry. |
| Tags | Tags | String | Tags for this element separated by semicolon. |
| Parent | Parent | String | The name of the existing data source to nest under. |
| DataSource | Data Source | AxQuerySimpleEmbeddedDataSource | The full embedded data source definition (Table, JoinMode, FetchMode, UseRelations, etc.). |
Field (AxQueryExtensionQueryDataSourceField)
| Property | Display Name | Type | Description |
|---|---|---|---|
| Name | Name | String | The name of the extension field entry. |
| Tags | Tags | String | Tags for this element separated by semicolon. |
| Parent | Parent | String | The name of the existing data source to add the field to. |
| QueryDataSourceField | Query Data Source Field | AxQuerySimpleDataSourceField | The field definition (Field, DerivedTable). |
Range (AxQueryExtensionQueryDataSourceRange)
| Property | Display Name | Type | Description |
|---|---|---|---|
| Name | Name | String | The name of the extension range entry. |
| Tags | Tags | String | Tags for this element separated by semicolon. |
| Parent | Parent | String | The name of the existing data source to add the range to. |
| QueryDataSourceRange | Query Data Source Range | AxQuerySimpleDataSourceRange | The range definition (Field, Value, Status, Enabled). |
Relation (AxQueryExtensionQueryDataSourceRelation)
| Property | Display Name | Type | Description |
|---|---|---|---|
| Name | Name | String | The name of the extension relation entry. |
| Tags | Tags | String | Tags for this element separated by semicolon. |
| Parent | Parent | String | The name of the existing data source to add the relation to. |
| QueryDataSourceRelation | Query Data Source Relation | AxQuerySimpleDataSourceRelation | The relation definition (Field, RelatedField, JoinDataSource, etc.). |
Order By Field (AxQueryExtensionQueryOrderByField)
| Property | Display Name | Type | Description |
|---|---|---|---|
| Name | Name | String | The name of the extension order-by entry. |
| Tags | Tags | String | Tags for this element separated by semicolon. |
| Parent | Parent | String | The name of the existing root data source to add the sort order to. |
| QueryOrderByField | Query Order By Field | AxQuerySimpleOrderByField | The order-by definition (Field, Direction, DataSource). |
Properties
| Property | Display Name | Type | Description |
|---|---|---|---|
| ExtensionAxQuerySimpleExtension | |||
| Name | Name | String | The name of the extension element (follows BaseQuery.Package naming). |
| IsObsolete | Is Obsolete | NoYes | Whether the extension is deprecated. Values: No (0), Yes (1). |
| Visibility | Visibility | CompilerVisibility | Access level visibility. Values: Private (0), Protected (1), Public (2), Internal (3), InternalProtected (4). |
| Tags | Tags | String | Tags for this element separated by semicolon. |