locked
UpdateRequest SuppressDuplicateDetection parameter does not work. RRS feed

  • Question

  • I am trying to update the account associated to a new Opportunity I am creating. I wrote a plugin to retrieve the account, update a field and then update the record. Problem is I get this error:

    A record was not created or updated because a duplicate of the current record already exists.

    It's being caused by the fact that I have a duplicate detection rule that sees another account that may be  duplicate of the one I'm trying to update. So I found this parameter I could set on the UpdateRequest object to make it ignore duplicate detection called SuppressDuplicateDetection. Problem is even if I set it to true I still get the error. Here is the code I am using.

                                UpdateRequest reqUpdate = new UpdateRequest();
                                reqUpdate.Target = accountEntity;
                                if (reqUpdate.Parameters.Contains("SuppressDuplicateDetection")) 
                                    reqUpdate.Parameters["SuppressDuplicateDetection"] = true;
                                else
                                    reqUpdate.Parameters.Add("SuppressDuplicateDetection", true);
                                UpdateResponse updateReponse = (UpdateResponse)service.Execute(reqUpdate);

    Based on my testing I can only assume that this parameter does not work. Has anyone else used this with any success?

    Tuesday, March 24, 2015 6:05 PM

Answers

  • MS did find a bug and has fixed it. The fix was delivered in the 0.2 Update.
    • Marked as answer by diver7 Wednesday, September 9, 2015 1:43 PM
    Wednesday, September 9, 2015 1:43 PM

All replies

  • I am having the same issue even if set it to true i still get below error. have you found a solution for this? .
    Business Process Error
    Error occured inside CreateCustomerTwo method. A record was not created or updated because a duplicate of the current record already exists.
    Tuesday, March 31, 2015 12:24 PM
  • I'm working with MS Support right now to resolve this. I'll post back when we find a resolution. In my case it appears to be linked to qualifying a Lead. I have two accounts that trigger one of my duplicate rules. I have a plugin that fires on create of an opportunity. The code retrieves the account record associated with the opportunity and updates a field on the account. If I create an opportunity directly the code works fine. If I create a Lead and then qualify it, the code does not work when the qualification process tries to create the opportunity. MS Support is trying to replicate the issue right now so they can troubleshoot it.
    Tuesday, March 31, 2015 12:56 PM
  • Hi Diver7 - any update on this issue already? I am experiencing the same: [ SuppressDuplicateDetection = True ] on Account update will still result in the Duplicate dialog. This customer is currently on 6.1 but will move to 7.0 soon. Thank you in advance.
    Monday, April 20, 2015 5:46 PM
  • Edwin,

    I'm having trouble getting MS Support to respond to me about this issue. I just escalated it to my MS Success Manager. Hopefully that will get it moving again. I will post info as soon I know anything.

    Monday, April 20, 2015 6:59 PM
  • The last time I tried it (which I think was v6.0), the SuppressDuplicateDetection worked fine. One thing to note, if you set this parameter within a plugin on the Update message, I think you need to register the plugin on the pre-validation stage (stage = 10) for it to apply.

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Tuesday, April 21, 2015 8:27 AM
    Moderator
  • MS Support thinks this is a product defect and is meeting with a Escalation Engineer today to see if we can get a hotfix. Stay tuned...
    Thursday, April 23, 2015 5:24 PM
  • MS did find a bug and has fixed it. The fix was delivered in the 0.2 Update.
    • Marked as answer by diver7 Wednesday, September 9, 2015 1:43 PM
    Wednesday, September 9, 2015 1:43 PM
  • We are experiencing this issue in CRM 2013 Service Pack 1 (UR3) - plugin is registered in pre-validation but it still shows duplicate detection popup even if we set the "SuppressDuplicateDetection" to true. Will this be fixed in CRM 2013?
    Tuesday, January 12, 2016 1:17 PM