web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
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

I have the same question (0)
  • Verified answer
    Pitipe Profile Picture
    686 on at

    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

     

  • KARTHIKGOWTHAM@SUYATITECH Profile Picture
    175 on at

    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

  • Anatoliy Veshemirsky Profile Picture
    on at

    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..

  • Anatoliy Veshemirsky Profile Picture
    on at

    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)

  • Suggested answer
    Pitipe Profile Picture
    686 on at

    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

  • Anatoliy Veshemirsky Profile Picture
    on at

    Hi Claire!

    Thank you so much for help!

  • Pitipe Profile Picture
    686 on at

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

  • Anatoliy Veshemirsky Profile Picture
    on at

    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?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans