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