Find your content:

Search form

You are here

Can I programmatically merge Leads to existing Accounts?

 
Share

We just discovered that we imported duplicate data into SFDC and have ~200 Leads with duplicate Accounts. I know that I can manually merge these objects in the UI by choosing to merge the Lead to an existing Account, but that would be very time consuming and tedious.

I see the merge() function only allows this with like objects (Leads with Leads, Accounts with Accounts).

Can this be done programmatically through the API?

Related:


Attribution to: Mike Chale

Possible Suggestion/Solution #1

Check out Salesfox.io - The application allows you to view Leads, Contacts, Accounts in a single view. It's also free if you're just looking at your own data and don't leverage enrichment or email validation functions.


Attribution to: Alex

Possible Suggestion/Solution #2

Yes, heres a sample from http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dml_convertLead.htm#leadConvertResult_object

Lead myLead = new Lead(LastName = 'Fry', Company='Fry And Sons');
insert myLead;

Database.LeadConvert lc = new     database.LeadConvert();
lc.setLeadId(myLead.Id)

   lc.setConvertedStatus(convertStatus);
lc.setAccountId(SET ACCOUNT ID);


Database.LeadConvertResult lcr =     Database.convertLead(lc);
System.assert(lcr.isSuccess());

Attribution to: techtrekker
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/4209

My Block Status

My Block Content