locked
Duplicate Record Detection. RRS feed

  • Question

  • Hello There ,

    Thanks in Advance ,

    my requirement is like, i have to make a plug-in who can fire an Alert if i am creating the Contact and the name of contact is already Exist ..

    i know tht CRM 2011 having feature of Duplicate Detection but i want to do this from plug-in so how can i do that ...

    please give me code..

     

    Sunday, June 17, 2012 8:13 AM

Answers

  • Your plugin will have to call retrievemultiple or fetch request for a list of contacts with the same name excluding the currently created one.

    And if the count is more than 0, there's a duplicate and you have to throw InvalidPluginExecutionException with some message and a use will get a message box like this.

    But if you want to prevent the user from creating the record, you've got to do it in Pre-Stage.

    There's a sample code for CRM 4.0 in the following post. You can reference it to re-write it for CRM 2011.

    http://mscrm4ever.blogspot.sg/2009/01/crm-40-creating-interactive-plug-ins.html

    Sunday, June 17, 2012 2:05 PM