-
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
All About Record Locking in Salesforce
In this blog entry, I'd examine the various approaches to secure a Salesforce record UI. By lock, I mean, the client shouldn't have the option…
Geo Location based on address in Salesforce
We can get geo locations for the addresses of accounts or leads or contacts in salesforce by making callouts to Google APIs. This can be…
Top 15 Salesforce Consulting Companies in the USA (2026)
In the rapidly evolving digital landscape of 2026, Salesforce has moved beyond being a simple CRM. With the rise of Agentforce AI, Data Cloud, and…
Popular Salesforce Videos
Lightning Data Service: An Easy Way to Build Lightning Components Without Code
Lightning Data Service is a centralized data caching framework which is used to load, save, create and delete a record without server-side apex code. It…
Salesforce Developer No Code and Code - Extended Version
Here you will find a showcase of new technologies, tools, product news, and tutorials from Salesforce experts. Learn to build, automate, and scale on the…
Understanding Future Method | Difference Between Asynchronous and Synchronous Apex in Salesforce
In this video, Shrey explained Synchronous Apex and Asynchronous Apex in a simple way. He also explained the importance of the Future method in Salesforce.…