View Extensions
A View Extension (AxViewExtension) modifies an existing AOT view without altering its original source code. View extensions follow the same overlay-free model as table and form extensions, enabling customisation while preserving upgradeability.
View extensions are created by right-clicking a view in the AOT and selecting Create extension. This creates an AxViewExtension object named <OriginalViewName>.<YourModelName> in your model.
What Can Be Extended
| Capability | Description |
|---|---|
| Add Fields | New computed or mapped view fields. |
| Add Field Groups | New field groups and extend existing groups via FieldGroupExtensions. |
| Add Data Sources | New embedded data sources joined to existing ones. |
| Add Ranges | New filter ranges on existing data sources. |
| Add Mappings | New table mappings. |
| Modify Properties | Change property values on existing elements via PropertyModifications. |
| Modify Fields | Change properties on existing fields via FieldModifications. |
note
View extensions cannot remove existing fields, data sources, or ranges. They are purely additive with property modification capability.
Extension Naming Conventions
| Pattern | Example | Description |
|---|---|---|
| Extension object | CustTransView.SAMOModel | Base view name + dot + your model name. |
| New fields | SAMOTierLevel | Prefix with your solution abbreviation. |
| New data sources | SAMOCustTierTable | Prefix + descriptive table name. |
Best Practices
- One extension per model per view. Do not create multiple extensions of the same view in a single model.
- Test the generated SQL. After adding fields or data sources, verify the resulting SQL view definition via database synchronisation.
- Be cautious with new data sources. Adding a joined data source changes the view's query plan and can affect performance on large datasets.
- Use computed fields sparingly. Complex expressions in view fields execute for every row and cannot be indexed.
- Add new fields to field groups to ensure they surface automatically on forms that consume the view.
Properties
| Property | Display Name | Type | Description |
|---|---|---|---|
| View ExtensionAxViewExtension | |||
| Name | Name | String | The name of the extension element (follows BaseView.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. |