Hi,
I had a requirement to create custom duplication rule using plugin.Is that possible to display the screen below if there is duplication record detected by the plugin?
Thanks.
Regards,
Teh
Hi Clofly,
It is working with data import now.
Thanks for your help.
Regards,
Teh
Hi Clofly,
Noted. I just open a new thread.
Regards,
Teh
Hi Teh,
Ok, I'll wait for your feedback.
If you had another question, please kindly open a new thread, thanks.
You could create a static function to remove accents from fullname field value with .NET Normalize library.
https://stackoverflow.com/questions/249087/how-do-i-remove-diacritics-accents-from-a-string-in-net
Regards,
Clofly
Hi Clofly,
Thanks for your help. I will try out later.
Now I had another problem, but also on duplication rule. My customer have some contact is stored in foreign language accents like José Gutiérrez, but when user try to create a new contact with Jose Gutierrez. Is there any way to detect it as duplication?
I tested using standard rule, it seem consider it as 2 separate records.
Thanks.
Regards,
Teh
Hi Teh,
That because during data import process, context depth equals 2.(depth: How many times the plugin is firing based on certain events)
Here is a thread to make us understand the concept.
In my original block, it's
if (context.Depth > 1) { return; }
Thus checking code will be passed.
So I changed the block to:
if (context.Depth > 2) { tracingService.Trace("Context depth is: {0}", context.Depth); return; }
Now it'll work for both creating record in form and data import process, and infinite loops will still be prevented.
Existing lead record:
Data in excel:
Error during data import process:
What'more, the stage of execution should be PreValidation.
Regards,
Clofly
Hi Teh,
I have tested the function, and also encountered your issue.
I'm trying to find a solution to handle it.
Regards,
Clofly
Hi Clofly,
Are you able to test the data import function?
Thanks.
Regards,
Teh
Hi Clofly,
Thanks for your prompt reply. I would prefer plugin instead of javascript, as javascript looks a little bit complex to me compare to sdk.
Thanks.
Regards,
Teh
Hi Teh,
Thanks for your feedback.
I got off work now, I'll test it for you tomorrow.
In addition, would you like to do it with javascript?
Regards,
Clofly
Hi Clofly,
I was trying to use your sample code in the 2nd post to create a custom plugin and check again contact entity for duplicate record.
I noticed that if I manual create/update record, it will prompt the error. But when I try to data import function, it seem the plugin is not working. The plugin I just check the lastname column.
In my past experience, the plugin should triggered regardless the data was create/update through the form itself or csv file import.
Can you test do you experience the same thing for data import in marketing app?
Thanks.
Regads,
Teh
André Arnaud de Cal...
292,074
Super User 2025 Season 1
Martin Dráb
230,900
Most Valuable Professional
nmaenpaa
101,156