• Dima Ivanov 17
  • NEWBIE
  • 25 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies
Hi,
I have standard objects Lead, Account, Contact and
custom object Opportunity__c , after the lead conversion need to create records in account , contact and custom opportunity records.
please help me out in the solution with the required code.

thanks,
srinivas 
I want to check the boxes and select convert all to Opportunities. The reason I want to do this is because (Setup à Object manager in quick find à Accounts à Fields and Relationships à New à rollup Summary) lets me create formulas based on Opportunities fields. I want to bulk convert the Leads into Opportunities so that I can sum up values there and build custom reporting with the leads getting sent to a Queue and with the leads getting sent to the opportunities. 

I want to automatically convert new leads into contacts. I have a trigger on Lead after update that will bulk convert 100 leads at a time. The problem I have  is that my marketing automation tool pushes new leads into Salesforce in batches of 200 at a time. When I try to import 200 leads, the bulk convert fails due to a too many DML 151 error.

 

I read that the convertlead function can only handle 100 records at a time. How can I edit the code to handle 200 imports at a time? Is it possible?

 

Thanks in advance.

 

trigger AutoConvert on Lead (after update) {

for(Lead myLead: Trigger.new){ if(Trigger.new[0].isConverted == false) { Database.LeadConvert lc = new database.LeadConvert(); lc.setLeadId(myLead.Id); lc.convertedStatus = 'Qualified'; //Database.ConvertLead(lc,true); lc.setDoNotCreateOpportunity(true); Database.LeadConvertResult lcr = Database.convertLead(lc); System.assert(lcr.isSuccess()); }}}

 

In addition to accounts, contacts, and opportunities, I'd like to be able to convert leads to a custom object (Programs).  I am not a developer am not technically savvy enough to create a Visualforce page or S-control to do this. If someone has done this and can share the code/formula with me, I'd appreciate it.