Skip to main content

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

CollectionChild TypePurpose
RootDataSourcesAxQuerySimpleRootDataSourceAdd entirely new root-level data sources to the query.
DataSourcesAxQueryExtensionEmbeddedDataSourceAdd new embedded (joined) data sources under an existing data source.
FieldsAxQueryExtensionQueryDataSourceFieldAdd fields to an existing data source's field list.
RangesAxQueryExtensionQueryDataSourceRangeAdd filter ranges to an existing data source.
RelationsAxQueryExtensionQueryDataSourceRelationAdd join relations to an existing embedded data source.
OrderByFieldsAxQueryExtensionQueryOrderByFieldAdd sort-order entries to an existing root data source.
PropertyModificationsAxPropertyModificationModify property values on existing query elements.
RangeModificationsAxExtensionModificationModify 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)

PropertyDisplay NameTypeDescription
NameNameStringThe name of the extension data source entry.
TagsTagsStringTags for this element separated by semicolon.
ParentParentStringThe name of the existing data source to nest under.
DataSourceData SourceAxQuerySimpleEmbeddedDataSourceThe full embedded data source definition (Table, JoinMode, FetchMode, UseRelations, etc.).

Field (AxQueryExtensionQueryDataSourceField)

PropertyDisplay NameTypeDescription
NameNameStringThe name of the extension field entry.
TagsTagsStringTags for this element separated by semicolon.
ParentParentStringThe name of the existing data source to add the field to.
QueryDataSourceFieldQuery Data Source FieldAxQuerySimpleDataSourceFieldThe field definition (Field, DerivedTable).

Range (AxQueryExtensionQueryDataSourceRange)

PropertyDisplay NameTypeDescription
NameNameStringThe name of the extension range entry.
TagsTagsStringTags for this element separated by semicolon.
ParentParentStringThe name of the existing data source to add the range to.
QueryDataSourceRangeQuery Data Source RangeAxQuerySimpleDataSourceRangeThe range definition (Field, Value, Status, Enabled).

Relation (AxQueryExtensionQueryDataSourceRelation)

PropertyDisplay NameTypeDescription
NameNameStringThe name of the extension relation entry.
TagsTagsStringTags for this element separated by semicolon.
ParentParentStringThe name of the existing data source to add the relation to.
QueryDataSourceRelationQuery Data Source RelationAxQuerySimpleDataSourceRelationThe relation definition (Field, RelatedField, JoinDataSource, etc.).

Order By Field (AxQueryExtensionQueryOrderByField)

PropertyDisplay NameTypeDescription
NameNameStringThe name of the extension order-by entry.
TagsTagsStringTags for this element separated by semicolon.
ParentParentStringThe name of the existing root data source to add the sort order to.
QueryOrderByFieldQuery Order By FieldAxQuerySimpleOrderByFieldThe order-by definition (Field, Direction, DataSource).

Properties

4/4 properties
PropertyDisplay NameTypeDescription
ExtensionAxQuerySimpleExtension
NameNameStringThe name of the extension element (follows BaseQuery.Package naming).
IsObsoleteIs ObsoleteNoYesWhether the extension is deprecated. Values: No (0), Yes (1).
VisibilityVisibilityCompilerVisibilityAccess level visibility. Values: Private (0), Protected (1), Public (2), Internal (3), InternalProtected (4).
TagsTagsStringTags for this element separated by semicolon.