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
chinnu 5chinnu 5 

"Find Duplicates" Button On Account Detail Record

I got requirement like on 'Account detail record'  create one button called "Find Duplicates".When click on this button  invoke the VF page to display the list of duplicate record matching with the current record.

I am doing the Account matching based on Account Name,  Phone, Website.

Please help me ASAP how to do with Apex class and VF page.....
JeffreyStevensJeffreyStevens
Create a button that calls your new VF page with the link of   - - .../apex/VFPageName?AccountId={!Account.Id} ...

And put it on the Account page layout.  You can call the parameter AccountID anything you like.

then in the constructor of the VF Page's controller get the Account ID like this...
 
// Get Account ID from URL
string pAccountID = ApexPages.currentPage().getParameters().get('AccountId');

Now, you can use that ID to SOQL the Account record for the Name, Phone, Website, and then another SOQL to get any accounts with those matching fields.

If you wanted to - you could pass the actual three fields - Account Name, Phone, & Website as parameters in the URL - I just like passing a few paramters as possible.