In my earlier post I described how CRM’s duplicate checker will happily find matches on partial matches due to its approach of matching blanks. A rule like:
… will match on just the First Name and Last Name fields when the E-mail field is blank, effectively opening your matching rule up to be just a name match, which can be far too broad.
The solution requires a bit of coding. Here’s the approach:
1. Create a new attribute on the Contact entity to hold a shadow copy of the Email address field, we don’t need it to be visible to our users so make it non-searchable and don’t bother placing it on the form.
2. Create a Plug-In or Custom Workflow Assembly that will either copy the value of the Email field into this new attribute, or, in the absence of a value, will paste the GUID of the Contact record into our new Email Match Field.
3. Change your duplicate check rule to refer to the new Email Match Field instead of the standard Email field.
And you’re done. A new Contact’s first name, last name and email address will be compared to the existing contacts, each of which will either have a proper email address or a GUID, so a match will require an existing contact to have the same email address.
Note: You’ll need to run your customisation across your existing data so keep that in mind when deciding on your approach.
If you want to match on name + phone number you can follow the same approach but in your custom code consider stripping the formatting out of your phone number to ensure formatting variations don’t hide any duplicates.