Sunday, July 25, 2021

Table extensions in D365FO

 Source: Customize through extension and overlayering - Finance & Operations | Dynamics 365 | Microsoft Docs

You can create a table extension to extend a table's design and logic. You can add new fields, field groups, indexes, mappings and relations. You can also add new fields to existing field groups, change the label of a table field, change the Created By, Created Date Time, Modified By, Modified Date Time properties. Using table extensions, you can also change the Extended Data Type property on fields and set it to an EDT that is derived from the current EDT (This is available as of platform update 8).

In Microsoft Dynamics AX 2012, you could override the virtual methods of a table's base class to control the behavior that occurred during table operations, such as when creating, reading, updating, or deleting. In the current version, you instead use extensions to implement event handlers that are called from the base implementations of the table methods. The following table lists each table method and its events.

TABLE EXTENSIONS
Published Table methodPreceding eventSucceeding event
validateWriteValidatingWriteValidatedWrite
validateDeleteValidatingDeleteValidatedDelete
validateFieldValidatingFieldValidatedField
validateFieldValueValidatingFieldValueValidatedFieldValue
modifiedFieldModifyingFieldModifiedField
modifiedFieldValueModifyingFieldValueModifiedFieldValue
InsertInsertingInserted
UpdateUpdatingUpdated
DeleteDeletingDeleted
InitvalueInitializingRecordInitializedRecord
FinalDeleteValidationExecuted when a delete operation is performed on a table object, before the operation is committed to the underlying database tableN/A
FinalInsertValidationExecuted when an insert operation is performed on a table object, before the operation is committed to the underlying database tableN/A
FinalReadValidationExecuted when a read operation is performed on a table object.N/A
FinalUpdateValidationExecuted when an update operation is performed on a table object, before the operation is committed to the underlying database table.N/A

Validation events capture and return results by using the DataEventArgs parameter. The display and edit method modifiers are supported on table extensions.

No comments:

Post a Comment