locked
QualifyLeadRequest triggers duplicate detection in CMR 2011? RRS feed

  • Question

  • I'm running into a problem when trying to qualify a lead using a QualifyLeadRequest. As far as I know, creating or updating records using the SDK shouldn't trigger duplicate detection. However, I'm getting the following error when trying to qualify the lead to a contact (it triggers duplicate detection rules on the contact):

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

    Anyone know how I can stop it from detecting duplicates?

    Thursday, August 7, 2014 1:41 PM

Answers

  • It is possible to control duplicate detection behaviour on Create and Update through the SDK, by using the SuppressDuplicateDetection parameter.

    Adding the SuppressDuplicateDetection parameter to the QualifyLeadRequest may work. Alternatively, a QualifyLeadRequest will cause any plugins for the Create message on the Pre-Operation (but not Pre-Validation) stage to fire, and you should be able to modify the SuppressDuplicateDetection parameter within a plugin - see http://mscrmuk.blogspot.co.uk/2014/04/controlling-duplicate-detection.html for an example of such a plugin 


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

    • Marked as answer by Miguel_P Tuesday, November 4, 2014 4:12 PM
    Thursday, August 7, 2014 3:29 PM
    Moderator

All replies

  • Hi ,

    You can unpublish duplication detection rules.

    http://msdn.microsoft.com/en-us/library/gg328289.aspx


    Polat Aydın Crm Software Developer

    Thursday, August 7, 2014 2:08 PM
  • Hi Polat,

    I realize that I can unpublish the detection rules, but they need to remain active. However, detection rules are normally not triggered by create or update requests using the SDK. The problem I'm having is that QualifyLeadRequest apparently does somehow trigger the duplication detection. I'd need to know how I can make it ignore the duplication detection rules.

    Thursday, August 7, 2014 2:12 PM
  • It is possible to control duplicate detection behaviour on Create and Update through the SDK, by using the SuppressDuplicateDetection parameter.

    Adding the SuppressDuplicateDetection parameter to the QualifyLeadRequest may work. Alternatively, a QualifyLeadRequest will cause any plugins for the Create message on the Pre-Operation (but not Pre-Validation) stage to fire, and you should be able to modify the SuppressDuplicateDetection parameter within a plugin - see http://mscrmuk.blogspot.co.uk/2014/04/controlling-duplicate-detection.html for an example of such a plugin 


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

    • Marked as answer by Miguel_P Tuesday, November 4, 2014 4:12 PM
    Thursday, August 7, 2014 3:29 PM
    Moderator
  • Hi David,

    Thanks, I'll try the SuppresDuplicateDetection parameter, though all the examples I've seen set it to false and mention that it's by default set to true. So I'm surprised to see this behavior where QualifyLead does trigger duplicate detection, but I'll try setting it to true. I do remember some oddities with qualifying leads in CRM 4.0 in the past, as those would sometimes give an error which ended up being caused by the duplication detection. This seems somewhat similar to that.

    I did find information about IsDuplicateDetectionEnabledForOnlineCreateUpdate:

    Organization.IsDuplicateDetectionEnabledForOnlineCreateUpdate. Create and update records in Microsoft Dynamics CRM by using the Web application or Microsoft Dynamics CRM for Microsoft Office Outlook. This attribute enables or disables duplicate detection for records created or updated with the CreateRequest and UpdateRequest messages. However, it does not affect records created or updated with the IOrganizationService.Create and IOrganizationService.Update methods.

    http://msdn.microsoft.com/en-us/library/gg334494(v=crm.5).aspx

    I was hoping setting that parameter to false would resolve the problem, but it didn't.

    Friday, August 8, 2014 7:20 AM
  • Adding the SuppressDuplicateDetection parameter to the QueryExpression (set to true) resolved the problem. I was under the impression that it was true by default, but apparently this isn't the case for a QualifyLeadRequest. Thanks!
    • Edited by Miguel_P Tuesday, November 4, 2014 4:21 PM
    Tuesday, November 4, 2014 4:21 PM