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
Vishnu7700Vishnu7700 

Need help to write merge trigger

Hi,

I'm haveing requriment like : There are two accounts A1 and A2,A1 having one open opportunity and A2 having one open opportunity when I try to merge A1 and A2 error should throws

 

for this i need to write trigger to merge account with conditions with custom button.

Sandeep001Sandeep001

Merge operation performs both update and delete operations.

Only way you can do is to write a trigger on delete operation and check for field 'MasterRecordId', which will contain the winner record Id. This field will be populated only if record is deleted out of merge operation.