Table Extensions
A Table Extension (AxTableExtension) modifies an existing table without altering its original source code. Extensions are the standard mechanism for customising tables delivered by Microsoft or other ISVs — they follow the overlay-free development model that ensures upgradeability.
Table extensions are created by right-clicking a table in the AOT and selecting Create extension. This creates an AxTableExtension object named <OriginalTableName>.<YourModelName> in your model.
What Can Be Extended
| Capability | Description |
|---|---|
| Add Fields | New fields of any base type (String, Integer, Real, Enum, etc.) with full EDT support. |
| Add Field Groups | New field groups and extend existing groups via FieldGroupExtensions. |
| Add Indexes | New indexes including full-text indexes. |
| Add Relations | New relations and extend existing relations via RelationExtensions. |
| Add Mappings | New table mappings. |
| Modify Properties | Change property values on existing elements via PropertyModifications. |
| Modify Fields | Change properties on existing fields via FieldModifications. |
| Modify Relations | Change properties on existing relations via RelationModifications. |
Extension Naming Conventions
| Pattern | Example | Description |
|---|---|---|
| Extension object | CustTable.SAMOModel | Base table name + dot + your model name. |
| New fields | SAMOCustTier | Prefix with your solution abbreviation to avoid collisions. |
| New indexes | SAMOCustTierIdx | Prefix + descriptive name + Idx suffix. |
| New relations | SAMOCustTier_FK | Prefix + descriptive name + _FK suffix. |
| New field groups | SAMOCustomFields | Prefix + descriptive group name. |
Always prefix new elements with your solution abbreviation (e.g., SAMO). Multiple ISVs may extend the same table — prefixed names prevent naming collisions.
Best Practices
- One extension per model per table. Do not create multiple extensions of the same table in a single model.
- Always use EDTs on new fields. Never add raw base-type fields without an EDT.
- Add new fields to field groups. Every new field should belong to at least one field group so it surfaces on forms automatically.
- Extend existing field groups using
FieldGroupExtensionsrather than creating entirely new groups when the field logically belongs with existing fields. - Test database synchronisation after adding fields or indexes — verify the SQL schema changes apply cleanly.
- Use
PropertyModificationssparingly. Changing properties on base elements can break other extensions or updates. Only modify when necessary and document the reason. - Never modify the clustered index of a base table — this can cause severe performance degradation and data reorganisation.
Extending Field Groups
The FieldGroupExtensions collection allows you to add fields to an existing field group defined on the base table. This is preferred over creating new field groups when the new field logically belongs alongside existing fields.
For example, to add a custom field to the AutoLookup group on CustTable:
- In the table extension, expand FieldGroupExtensions.
- Add a reference to the
AutoLookupgroup. - Add your field (
SAMOCustTier) to the group extension.
The field will then appear in all lookups for CustTable without modifying the base table.
Extending Relations
The RelationExtensions collection lets you add new constraints to an existing relation. This is useful when an extension field needs to participate in an existing join condition.
The RelationModifications collection lets you modify properties on existing relation definitions — for example, changing the DeleteAction behaviour.
Properties
| Property | Display Name | Type | Description |
|---|---|---|---|
| Table ExtensionAxTableExtension | |||
| Name | Name | String | The name of the extension element (follows BaseTable.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. |
| FormRef | Form Ref | String | Menu item identifying the default form for this table (can be overridden in extension). |
| Field Group ExtensionAxTableFieldGroupExtension | |||
| Name | Name | String | The name of the existing field group to extend. |
| Tags | Tags | String | Tags for this element separated by semicolon. |
| Relation ExtensionAxTableRelationExtension | |||
| Name | Name | String | The name of the existing relation to extend. |
| Tags | Tags | String | Tags for this element separated by semicolon. |