locked
Duplicate detection - CRM 4.0 RRS feed

  • Question

  • Hi,

    I'm just wondering if there is an easy way to disable duplicate detection on edit, but still have the duplicate detection on create running. This is what I'm trying to accomplish. I have created a rule to check between a lead to an account on company name. However, sometimes we still want to have a lead created even though there already is an account name that match the company name in a lead. The problem is, every time we edit the lead, the duplicate detection will prompt us that there is a duplicate. Any ideas on how to accomplish this?

    Thursday, May 20, 2010 4:52 PM

Answers

  • The hard way to do it is to disable the Duplicate Detection feature on your entity altogether, and simply write a plugin that fires only on the Create message (ideally in the child-pipeline to catch all record creations) and checks for duplicates.  You could make the code somewhat flexible by accepting parameters specified in the "unsecure configuration" area of plugin registration that defines the attributes on which you want the code to check for duplication (this way you don't have to code individual attribute checks or recompile every time you want to change which attributes are being examined for duplication).
    Dave Berry
    Thursday, May 20, 2010 7:38 PM
    Moderator

All replies

  • Unfortunately, the options for duplication detection mean that checking for duplicates happens on both create and update, or neither.  I was trying to think of a way to subvert it for updating, but can't off the top of my head.
    Dave Berry
    Thursday, May 20, 2010 5:00 PM
    Moderator
  • Thank you for replying.

    If there is no easy way to do this, what is the hard way to do it?

    Thursday, May 20, 2010 7:11 PM
  • The hard way to do it is to disable the Duplicate Detection feature on your entity altogether, and simply write a plugin that fires only on the Create message (ideally in the child-pipeline to catch all record creations) and checks for duplicates.  You could make the code somewhat flexible by accepting parameters specified in the "unsecure configuration" area of plugin registration that defines the attributes on which you want the code to check for duplication (this way you don't have to code individual attribute checks or recompile every time you want to change which attributes are being examined for duplication).
    Dave Berry
    Thursday, May 20, 2010 7:38 PM
    Moderator