Activity Forums Salesforce® Discussions How to Bypass Merge Operation for this specific scenario? (read description below)

  • How to Bypass Merge Operation for this specific scenario? (read description below)

    Posted by Naman on April 30, 2016 at 5:30 pm

    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

    Surbhi replied 8 years, 6 months ago 2 Members · 1 Reply
  • 1 Reply
  • Surbhi

    Member
    June 14, 2016 at 6:44 am

    Hi Naman,

    I think you will receive the winning record Id in after delete event after the merging operation. I am still working on this and will update you soon.

    Thanks

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos