Ever wanted to get some more "fuzziness" in your detection rules? Then Soundex as a phonetic algorithm will be your friend. There are some caveats but for some applications it might be useful. The nice thing is, that it's super-easy to implement.
Let's consider two options (in your project you might want to go for a "best of both worlds" approach by using both):
Method1 Clientside: Generating the Soundex-Code at the onSave event
Pro: Quick and easy implementation
Con: Will not work on imports or Bulk Operations
Step by step:
1) add a custom field "new_soundex_lastname" to the desired entity (lead, account, contact or any custom entity)
2) add the field to the form
3) add this onSave event:
function soundex(str) {
// original from http://phpjs.org/functions/soundex:520
var i, j, l, r, p = isNaN(p) ? 4 : p > 10 ? 10 : p < 4 ? 4 : p;
var m = {BFPV: 1, CGJKQSXZ: 2, DT: 3, L: 4, MN: 5, R: 6};
var r = (s = (str+'').toUpperCase().replace(/[^A-Z]/g, "").split("")).splice(0, 1);
var sl = 0;
sl = s.length;
for (i = -1, l = sl; ++i < l;) {
for (j in m) {
if (j.indexOf(s[i]) + 1 && r[r.length-1] != m[j] && r.push(m[j])) {
break;
}
}
}
return r.length > p && (r.length = p), r.join("") + (new Array(p - r.length + 1)).join("0");
}
crmForm.all.new_soundex_lastname.DataValue=soundex(crmForm.all.lastname.DataValue);
4) add a duplicate rule & publish
5) enjoy life without unneccessary duplicates ;-)
Method 2 Plugin: Firing at Pre-Create event
Pro: Works on Imports
Con: A bit more work
Again a great blog post Mario Raunig! I really admire you!
AntwortenLöschenKeep up your fantastic work and keep on blogging! Your contribution to the MS CRM community is highly appreciated!
... besonders die abgebildeten duplikate sind wirklich unnötig. Schöner Seitenhieb. :-D
AntwortenLöschenYou have really great taste on catch article titles, even when you are not interested in this topic you push to read it
AntwortenLöschenI am reading this article second time today, you have to be more careful with content leakers. If I will fount it again I will send you a link
AntwortenLöschenWonderful post! Youve made some very astute observations and I am thankful for the the effort you have put into your writing. Its clear that you know what you are talking about. I am looking forward to reading more of your sites content.
AntwortenLöschenDynamics crm training
This does not apply to latest Dynamics CRM version. Please update!
AntwortenLöscheni have never thought it would be so easy to do. thank you for your explanatory introduction
AntwortenLöschen