Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add existing records in AfterDelete #101

Open
OpheliePeach opened this issue Nov 20, 2024 · 0 comments
Open

Add existing records in AfterDelete #101

OpheliePeach opened this issue Nov 20, 2024 · 0 comments

Comments

@OpheliePeach
Copy link

OpheliePeach commented Nov 20, 2024

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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant