Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Duplicate detection rules based on condition

(0) ShareShare
ReportReport
Posted on by

Hello All

I have question about duplicate detection rule.

is there any way to write duplicate detection rule based on two parameters.

for example in invoice entity, I have 2 fields, field 1: invoice number and field2: invoice type(1 and 2)

I want duplicate detection find duplicates between invoice number which invoice type is 1 or 2.

for better understanding see the below example

if invoice number = 2005 and invoice type =1

and invoice number =2005 and invoice type =2

the duplicate detection rule has no job

but otherwise if invoice number =2005 and invoice type =1

and invoice number =2005 and invoice type =1

the duplicate detection must detect the duplicate.

Thank you

*This post is locked for comments

  • Verified answer
    David Jennaway Profile Picture
    14,063 on at
    RE: Duplicate detection rules based on condition

    It sounds like the suggestion in the previous post should do what you need.

    For reference, duplicate detection does not allow complex logic. However, in some circumstances you could use complex logic (in client script, business rules or a pre-event plugin) to populate one or more derived fields, and run the duplicate detection rule on the derived field(s)

  • Verified answer
    ashlega Profile Picture
    34,477 on at
    RE: Duplicate detection rules based on condition

    Hi Anna,

     in general, you can't create that kind of complicated rules.. But, in your example, why don't you just create a rule that will be looking at the invoice number AND invoice type fields?

     It will only detect a duplicate if both fields are a match (if it's the same number but different types, it won't be a match)

  • Suggested answer
    Loz Profile Picture
    2 on at
    RE: Duplicate detection rules based on condition

    Hi Anna,

    Gopalan is correct, all criteria on a duplicate detection rule must be met for a duplicate to be identified. For example, in the below rule, both the first and last name on a Contact must match for a duplicate to be identified.

    Duplicate-Detection-Answer.PNG

    So:

    • First Name = "Bob", Last Name = "Smith", AND
    • First Name = "Bob", Last Name = "Jones" = No duplicate
    • First Name = "Bob", Last Name = "Smith", AND
    • First Name = "Bob", Last Name = "Smith" = Duplicate
  • Community Member Profile Picture
    on at
    RE: Duplicate detection rules based on condition

    Hi Gopalan

    thank you

    but this is not what I'm looking for

  • Verified answer
    Gopalan Bhuvanesh Profile Picture
    11,401 on at
    RE: Duplicate detection rules based on condition

    Hi

    Create a new Duplicate Detection Rule.

    In the Duplicate Detection Rule select the entity.

    Add these two fields as Exact Match (also check Ignore Blank Values).

    This is AND condition, so if both of these field values match in another record it would detect.

    Please refer the following:

    https://msdn.microsoft.com/en-us/library/gg309427.aspx

    http://www.xrmlabs.com/About-Us/XRMs-Blog/Post/367/Duplicate-Detection-Rules-of-Microsoft-Dynamics-CRM-2013

  • Community Member Profile Picture
    on at
    RE: Duplicate detection rules based on condition

    HI Gopalan

    Please tell me more

  • Suggested answer
    Gopalan Bhuvanesh Profile Picture
    11,401 on at
    RE: Duplicate detection rules based on condition

    Hi

    Yes, you can compare multiple fields in Duplicate Detection Rule.

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... 293,278 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,998 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans