function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Maverick123Maverick123 

Save child delete on Merge

Hi Guys,

 

I have a unique problem here, my issue is

 

1) I have a child object on Account with Lookup relationship. I have a OnDelete trigger on Account, so when the Account is deleted the child gets deleted, so far good.

2) But when the Account is "Merged", in this case too the child record gets deleted and the merging of the records is incorrect.

 

I would like to able to differentiate, if the deletion of the Account is whether via 'merge' request or if specifically called.

 

I would then like to bypass it in the on delete trigger. I found a field MasterRecordId on account, but not sure, if it gets set on the Loser/deleted account.

 

Please advise.

 

Thanks,

Maverick

Jia HuJia Hu