web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • Suggested answer
    Gopalan Bhuvanesh Profile Picture
    11,401 on at

    Hi

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

  • Community Member Profile Picture
    on at

    HI Gopalan

    Please tell me more

  • Verified answer
    Gopalan Bhuvanesh Profile Picture
    11,401 on at

    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

    Hi Gopalan

    thank you

    but this is not what I'm looking for

  • Suggested answer
    Loz Profile Picture
    2 on at

    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
  • Verified answer
    ashlega Profile Picture
    34,477 on at

    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)

  • Verified answer
    David Jennaway Profile Picture
    14,065 on at

    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)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans