Supported Add-On Api events.


List of supported events available for triggering Add-On module.

Event Name Event Scope The event definition in the export.json Triggerring conditions Description
OnBefore Script "beforeAddons": [
{
...
}
]
➦ Triggered once per job
➦ Triggered before the migration job is started
➦ There are no records yet to access and modify.
➦ The script configuraiton can be modified
OnAfter Script "afterAddons": [
{
...
}
]
➦ Triggered once per job
➦ Triggered after the migration job is completed
➦ Modifications will not have any impact
OnDataRetrieved Script "dataRetrievedAddons": [
{
...
}
]
➦ Triggered once per job
➦ Triggered after all records of all objects are already retrieved from the Source and the Target, but before starting to update the Target.
➦ The source records of all objects can be accessed and modified.
➦ The target records of all objects can be accessed and modified only if not Insert operation is being executed, since on Insert the records do not exist in the Target yet.
Object.OnBefore Object "beforeAddons": [
{
...
}
]
➦ Triggered once in loop for each object
➦ Triggered after all records of all objects are already retrieved from the Source and the Target, but before starting to update the Target.
➦ Triggered before the OnDataRetireved event
➦ Similar to the global OnDataRetrieved event, but in the object scope.
➦ The same actions can be done in both events as your preference.
Object.OnAfter Object "afterAddons": [
{
...
}
]
➦ Triggered once in loop for each object
➦ Triggered after all objects are already updated, but before the job is completed.
➦ Triggered before the global OnAfter event
➦ Similar to the global OnAfter event but in the object scope.
➦ The same actions can be done in both events as your preference.
Object.OnFilterRecords Object "filterRecordsAddons": [
{
...
}
]
➦ Triggered once per object
➦ Triggered when the source records are prepared for updating the Target.
➦ Triggered before the OnBeforeUpdate event
➦ Here you can access, modify and filter the source records using the tempRecords property defined in the SfdmuRunAddonTask object.
➦ The modified records you are assigning to this property will be used as the data source for this object to update the Target org.
Object.OnBeforeUpdate Object "beforeUpdateAddons": [
{
...
}
]
➦ Triggered once per object during the target update phase
➦ Triggered just before the current object is going to be updated in the Target org.
➦ The source records can be accessed and modified.
➦ Here you have the only option to assess and modify the final version of the source records which are now about to be transferred to the Target.
➦ For your convenience, you also can work with 2 separated groups of records: RecordsToBeUpdated and RecordsToBeInserted
Object.OnAfterUpdate Object "afterAddonsUpdateAddons": [
{
...
}
]
➦ Triggered once per object during the target update phase
➦ Triggered immediately after the current object is updated in the Target org.
➦ Both the source and the target records can be accessed and modified.
➦ Since this event is triggered during the update phase of the object, so unlike the OnAfter event your modification of the records can have impact on processing of other objects which were not processed yet.

The Add-On Event and Script Execution Lifecycle

Below is the order of Add-On events invocation along with script execution actions:

Action: Script execution starts...

Event: Script.OnBeforeAddons

Action: Query source data cycle starts...

Action: Querying for total records count of each object ...

Action: Querying the source records...

Action: Querying the target records...

Action: Query source data cycle completed...

Event: Object.OnBeforeAddons(in loop for each object)

Event: Script.OnDataRetrieved

Action: Update target cycle starts...

Action: Update for the given object starts...

Action: Determine records needing update/insert for the given object...

Event: Object.OnFilterRecords

Action: Prepare records for update...

Event: Object.OnBeforeUpdateAddons

Action: Update the target for the given object...

Event: Object.OnAfterUpdateAddons

Action: Update of the given object completed, continue to the next object...

Action: Update target cycle completed...

Event: Object.OnAfterAddons (in loop for each object)

Event: Script.OnAfterAddons

Action: Script execution completed...

Last updated on 15th Mar 2024