Skip to content

Add existing records in AfterDelete #101

@OpheliePeach

Description

@OpheliePeach

Hello !
When I try to use an AfterDelete trigger, I wanted to use existingRecords but it's null while Trigger.old/Trigger.oldMap is available in delete triggers -> Trigger Context Variables

So I think we can add it in the handleAfterDelete method -> src\frameworks\at4dx\sfdx-source\core\main\classes\framework-application-factory\ApplicationSObjectDomain.cls

public virtual override void handleAfterDelete(Map<Id,SObject> existingRecords)
    {
        super.handleAfterDelete(existingRecords);
        this.getDomainProcessCoordinator().processDomainLogicInjections( DomainProcessConstants.PROCESS_CONTEXT.TriggerExecution, System.TriggerOperation.After_Delete, existingRecords );
    }

EDIT: It's the same for handleBeforeDelete
Thank you !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions