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
My OwnMy Own 

Reg: Issue with Merge Contacts.

 

Hi All,

 

I was trying to do "Merge Contact" Process, My current execution is allows only 100 merge operations at a time, but What I require is to process more that 100 merge contacts in a single process.  

 

Is it possible to do bulk merge process, if so please provide better solution.

 

Thanks in Advance.   

 

My Sample Code :

 

 public string contactMerge(List<Contact> masterContact)
        {
            try{ 
                       
                for(integer i=1;i<masterContact.size();i+=2)
                   {
                       if (i == masterContact.size()-1)
                       {
                         merge masterContact[0] new Contact[] {masterContact[i]};
                       }
                       else
                       {
                          merge masterContact[0] new Contact[] {masterContact[i],masterContact[i+1]};
                       }
                   }
             }//eof try
             catch(Exception ex){
                        system.debug('Exception Message'+ex.getMessage());
              }
               return 'Success';
        }