function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
abhishek_kumar371abhishek_kumar371 

Call Duplicate Rule defined(Standard) on click of Button.

Hi,

I have a requirement where i need to get the list of matching records returned by duplicate rule(Standard) on click of button.I am looking for the logic to call duplicate rule on click of button.
Best Answer chosen by abhishek_kumar371
AB TestAB Test
Hi

 You can not use Standard Duplicate management on click of Button or using apex. But you can do this with a workaround to satisfy your requirement.:

Write an Apex class which would accept the criteria against which duplication is to be checked and you can check and fetch the matching records using SOQL and return that list.

 Call this Apex class onclick of standard button on detail page or custom button on vf page using following code which is used to call apex class and display the duplicate records returned from the method.
sforce.apex.execute();

Hope this helps. 

Please mark the answer as best answer or like it if it helps :)