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
kirubakaran viswanathankirubakaran viswanathan 

Unable to convert the lead to existing contacts with new Contact value

I tried to convert the lead through batch processing, which need to update the existing contact based on the contact id. But the value in the contact record is not overwritten with the Lead value.
Can anyone help on this? Even I set the setOverwriteLeadSource(true); 
for(Lead record: scope) {
            Database.LeadConvert lc = new Database.LeadConvert();
            lc.setLeadId(record.Id);
            lc.setConvertedStatus(convertedStatus);
            
            if(matchAcct.containsKey(record.company))
            {
                lc.setAccountID(matchAcct.get(record.company).id);
            }
            if(matchCont.containsKey(record.Email))
            {
                lc.setContactID(matchCont.get(record.Email).id);
            }
            
            lc.setDoNotCreateOpportunity(true);
            lc.setOverwriteLeadSource(true);
            converts.add(lc);
        }
        
        system.debug('ConvertsLeads:' +converts);
       // Database.LeadConvertResult lcr ;
       List<Database.LeadConvertResult> lcr = Database.convertLead(converts,false);

 
kirubakaran viswanathankirubakaran viswanathan
Nevermind... I got the answer. We need to explicity map the fields to merge with contact details. 
Thanks,
Kiruba. V