Supported Add-On Api events.
Table of Contents
- List of Supported Events Available for Triggering Add-On Modules
- The Add-On Event and Script Execution Lifecycle
List of Supported Events Available for Triggering Add-On Modules ⇧
Event Name | Event Scope | The event definition in the export.json | Triggering Conditions | Description |
---|---|---|---|---|
OnBefore | Script | "beforeAddons": [ { ... } ] |
➦ Triggered once per job ➦ Triggered before the migration job starts |
➦ No records are yet accessible for modification. ➦ The script configuration can be modified. |
OnAfter | Script | "afterAddons": [ { ... } ] |
➦ Triggered once per job ➦ Triggered after the migration job completes |
➦ Modifications will not impact the migration as it has already completed. |
OnDataRetrieved | Script | "dataRetrievedAddons": [ { ... } ] |
➦ Triggered once per job ➦ Triggered after all records from all objects are retrieved from the Source and the Target, but before updating the Target. |
➦ Access and modification of source records from all objects are possible. ➦ Target records from all objects can also be modified unless an Insert operation is being executed. |
Object.OnBefore | ScriptObject | "beforeAddons": [ { ... } ] |
➦ Triggered once per object in a loop ➦ Triggered after all records from the Source and the Target are retrieved but before updating the Target. ➦ Triggered before the OnDataRetrieved event |
➦ Similar to the OnDataRetrieved event but scoped to individual objects. ➦ Allows the same modifications as the OnDataRetrieved event. |
Object.OnAfter | ScriptObject | "afterAddons": [ { ... } ] |
➦ Triggered once per object in a loop ➦ Triggered after all objects are updated but before the job completes. ➦ Triggered before the global OnAfter event |
➦ Similar to the global OnAfter event but scoped to individual objects. ➦ Allows modifications that may still impact subsequent processing. |
Object.OnFilterRecords | ScriptObject | "filterRecordsAddons": [ { ... } ] |
➦ Triggered once per object ➦ Triggered when source records are prepared for updating the Target. ➦ Triggered before the OnBeforeUpdate event |
➦ Enables access, modification, and filtering of source records using the tempRecords property in the SfdmuRunAddonTask object. ➦ Modified records assigned to this property will be used as the data source for updating the Target org. |
Object.OnBeforeUpdate | ScriptObject | "beforeUpdateAddons": [ { ... } ] |
➦ Triggered once per object during the target update phase ➦ Triggered just before the current object is updated in the Target org. |
➦ Access and modification of the source records are possible. ➦ Provides the only opportunity to modify the final version of the source records before transfer to the Target. ➦ Allows working with two separated groups of records: RecordsToBeUpdated and RecordsToBeInserted. |
Object.OnAfterUpdate | ScriptObject | "afterUpdateAddons": [ { ... } ] |
➦ Triggered once per object during the target update phase ➦ Triggered immediately after the current object is updated in the Target org. |
➦ Both source and target records can be accessed and modified. ➦ Since this event is triggered during the update phase of the object, modifications can impact the processing of other objects that have not yet been processed. |
The Add-On Event and Script Execution Lifecycle ⇧
Below is the sequence of Add-On event invocations along with script execution actions:
Action: Script execution begins...
Event: Script.OnBeforeAddons
Action: Source data query cycle starts...
Action: Querying for total record counts of each object...
Action: Querying source records...
Action: Querying target records...
Action: Source data query cycle completes...
Event: Object.OnBeforeAddons
(in loop
for each object)
Event: Script.OnDataRetrieved
Action: Target update cycle starts...
Action: Update begins for the given object...
Action: Determining records needing updates or inserts for the given object...
Event: Object.OnFilterRecords
Action: Preparing records for update...
Event: Object.OnBeforeUpdateAddons
Action: Updating the target for the given object...
Event: Object.OnAfterUpdateAddons
Action: Update of the given object completed, proceed to the next object...
Action: Target update cycle completed...
Event: Object.OnAfterAddons
(in loop for each object)
Event: Script.OnAfterAddons
Action: Script execution completed...