Skip to content

IF_Trigger.AfterDelete

Class

apex
global interface IF_Trigger.AfterDelete

Known Derived Types: TRG_ExecuteValidationRules, TRG_ExecuteValidationRules.afterDelete(List<SObject>)

Handler contract for the after-delete trigger event.


Methods

MethodDescription
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.

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

ParameterTypeDescription
oldRecordsListThe batch of SObjects that were deleted.

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');
    }
}