IF_Trigger.AfterDelete
Class
apex
global interface IF_Trigger.AfterDeleteKnown Derived Types: TRG_ExecuteValidationRules, TRG_ExecuteValidationRules.afterDelete(List<SObject>)
Handler contract for the after-delete trigger event.
Since: 1.0
Methods
| Method | Description |
|---|---|
| global abstract void afterDelete(List<SObject> oldRecords) | Called after records have been deleted, enabling cleanup of orphaned child records, external system notifications, or aggregate recalculation. |
Method Details
afterDelete
apex
global abstract void afterDelete(List<SObject> oldRecords)Called after records have been deleted, enabling cleanup of orphaned child records, external system notifications, or aggregate recalculation.
Parameters:
oldRecords(List) - The batch of SObjects that were deleted.
Since: 1.0
Example:
apex
public class TRG_CleanupOrphanedFiles extends TRG_Base implements IF_Trigger.AfterDelete
{
public void afterDelete(List<SObject> oldRecords)
{
Set<Id> deletedIds = new Map<Id, SObject>(oldRecords).keySet();
LOG_Builder.build().info('Cleaned up ' + deletedIds.size() + ' records').emitAt('TRG_CleanupOrphanedFiles');
}
}