Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Custom Duplicate Detection Rules

(0) ShareShare
ReportReport
Posted on by

Hi!

In contact entity I have three fields for emails (emailaddress1, emailaddress2, emailaddress3).

How I could make cross duplicate detect when I'm creating new contact?

Example:

Contact 1 has (emailaddress1 = 1@mail.ru; emailaddress2 = 2@mail.ru; emailaddress3 = 3@mail.ru;)

I try to create new contact (emailaddress1 = 4@mail.ru; emailaddress2 = 1@mail.ru; emailaddress3 = 5@mail.ru;)

I need to detect this.

How I could solve it? 

*This post is locked for comments

  • RE: Custom Duplicate Detection Rules

    Hi Claire! I have an issue about duplicate rule: I created a new contact with email1 and email2. All ok (The same email addresses appeared in Email Log entity). But when I want change contact record (change any field - not email), I'm getting alert about duplicate... How I could fix it? Have you any ideas?

  • Pitipe Profile Picture
    Pitipe 686 on at
    RE: Custom Duplicate Detection Rules

    No Problems - shout if you need anything else. I don't code so can make workflows do most things ;)

  • RE: Custom Duplicate Detection Rules

    Hi Claire!

    Thank you so much for help!

  • Suggested answer
    Pitipe Profile Picture
    Pitipe 686 on at
    RE: Custom Duplicate Detection Rules

    Hi

    if you have set the workflow to be on creation or change of the email field that will automatically create a new email log if the email changes

    if you want to delete the email log if the email is removed what you could do is.....

    create 3 lookup fields in the contact entity looking up to the email log

    put in a final step in the email log to push the record created back to the contact into the relevant lookup field

    we already had a condition to check if the email contained data, what you could do is amend that slightly so if it does not contain data but the look up field does, deactivate the record in the email log field and then clear that field in the contact

    I probably wouldn't worry on the deactivating of the email log if i am honest but there is that as an option.

    Hope this makes sense

    Claire

  • RE: Custom Duplicate Detection Rules

    Hi, Karthik Srirangaraj!

    I wrote same plugin at the first day, but my customer didn't want it. I need to solve it without plugin (only customization)

  • RE: Custom Duplicate Detection Rules

    Hi Claire!

    First of all, thanks for help.

    I have one issue: what should I do, when I change (or delete) emailaddress1 or emailaddress2 on Contact Entity?

    In general, I need update record (or delete) in Email log Entity. I tried to do it, but I couldn't update Email log record (I couldn't find Email log relation in list). I created relation Contact-Email log but all the same..

  • RE: Custom Duplicate Detection Rules

    Hi Anatoliy Veshemirsky,

    I doubt that we have any OOB feature to do this. If I were you, I would write a plugin to cross check all the possible email fields,  if a contact exists, then I will throw an error for Duplicate contact.

    Regards,

    Karthik

  • Verified answer
    Pitipe Profile Picture
    Pitipe 686 on at
    RE: Custom Duplicate Detection Rules

    Hi Anatoliy

    I have just tested the following and it all works so fingers crossed this makes sense to you (and if there is an easier way at least you have options)

    1. Create a custom entity called Email log

    • New field – lookup to contact
    • Add contact field into the views and forms

     

    2. Created a workflow against contact – on creation or change of email

    • Condition to check if the email contains data

    • Create a new “email log record”

    • I mapped the email to name and then the contact to contact

     

    Note: I then created 2 more workflows, 1 for each email address. I did think about doing everything in one but then wouldn’t know what email fields to map to so thought there wold be additional email logs so tried this 3 workflow method

     

     I just set mine up as on demand as well and run them on all of the existing contact records so I had email log records with email address and could test everything.

     

    3. Now create the duplication rule

     You will need to create a separate rule for each email address but they will all have the same concept.
    Contact and email log entity

    Email field / name field

    7024.10.png

     

    4. Publish then it should all work

    It just worked for me so fingers crossed it you will get the same results

    7024.10.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans