Hi All,
We have few deduplication rules written for contact. Some of fields input might not come while creation of record itself. They may be entered at later stages. The Requirement is to detect duplicates when saving contact record after entering those specific fields similar to when duplicates shown while creating the document.
I need your help on how we can call that deduplication service and show the results. Please help me achieve this functionality.
Thanks in Advance.
Like
Hello Nagaraju,
Thank you for your question!
If you want the records to be checked for duplicates not only when it's created, but every time it's modified, we would recommend creating a Replacing Schema for the Base Entity Page and pasting the following strings in it:
define("BaseEntityPage", [], function(DeduplicationConstants) { return { details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/, modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/, messages: {}, mixins: {}, methods: { /** * @inheritdoc Terrasoft.BaseEntityPage#asyncValidate * @overridden */ asyncValidate: function(callback, scope) { this.callParent([function(result) { if (result.success && this.get("PerformSearchOnSave")) { this.findOnSave(callback, scope); } else { callback.call(scope, result); } }, this]); }, }, diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/ }; });
Please note, that this logic will trigger the duplication check for every page on every change made (even in the fields that are not being checked by your rule).
You can use it as is or modify it so it fits your business logic better.
Hope this helps!
Regards,
Danyil