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
Rodolfo CalvoRodolfo Calvo 

Merge contacts apex method

Hello team,

Is there a good tutorial to make a merge contacts app in apex? 
I have been looking for how to do this. Please could someone explain to me how to make a aplic custom visualforce merge page for contacts or accounts?? 

Thanks in advance! 
Best Answer chosen by Rodolfo Calvo
Rodolfo CalvoRodolfo Calvo
Is there any way to copy all contacts from one account to another? 

All Answers

Hargobind_SinghHargobind_Singh
Hi,

You can use Database.merge() apex function to achieve this. Unfortunately, I don't have any ready code to share, you would need to write a Visualforce page to do this. I found a mockup that someone built here: https://code.google.com/p/npsp/wiki/ContactMerge

And you can find some help here for merge (and other DML functions): https://developer.salesforce.com/trailhead/apex_database/apex_database_dml


 
Rodolfo CalvoRodolfo Calvo
Is there any way to copy all contacts from one account to another? 
This was selected as the best answer