-
How to Bypass Merge Operation for this specific scenario? (read description below)
I have a requirement in which system will allow to delete an account only when its related contacts status are inactive...if any of the contacts are active then it should throw an error message.. I have fulfilled this functionality by writing apex code on beforedelete event..My code is working fine but there is a standard functionality in Salesforce called as "Merging"........In that scenario when i merge two accounts,if loosing account contains active records then it is throwing me validation message...but I have to bypass my code when it comes to the merging....
Can anybody suggest me,how I bypass the code?
One thing I tried,note down the masterid of winning record and put in my condition where I can bypass the scenario..but when I merge the accounts then I am not able to get MasterID of Winiing record....I am not sure why this is happening???
Ideally I should get some ID of the merge operation
Log In to reply.
Popular Salesforce Blogs

Accessibility in Salesforce - An Overview
What is Accessibility? In practice, accessibility is intended for users with disabilities. Globally, nearly 300 million people have some form of visual impairment and nearly…

Salesforce Slack Acquisition – 5 Reasons Why This Merger is the Best Thing Since Sliced Bread!
Salesforce is bringing in a huge wave of features and services for its users this year. Before the end of 2020, Salesforce signed a $27.7 billion megadeal to…

Salesforce Marketing Cloud Hacks You Must Try
For any Marketing Cloud professional, it is important to know the ins and outs of the product so it can be used to its full…
Popular Salesforce Videos
How to Manage Bulk Data in Salesforce?
Data is at the heart of everything you do in your business. It is also the engine that drives your Salesforce instance. Without it, how…
What are APEX Environments? | Learn Salesforce Development
In this video, Shrey explained the Apex Environments. He covered answers for the following questions while explaining: What are the APEX Environments? Different types of…
What is Lead Assignment rule in Salesforce and How to create it?
This video explains Lead Assignment rules in depth in an interesting way and fun way. This video is divided into 4 parts: - What is…