You need to sign in to do that
Don't have an account?
Navneeth
Lead Conversion trigger code
Hi i need a Lead conversion trigger code to convert lead to account/contact. The trigger should use standard database.leadconvert() method. The following is the skeleton of how the trigger should work. Please give me the code asap as it is urgent Please find the details of lead conversion Trigger on Lead Trigger on lead( after insert) { Get the trigger size (Integer)- takelist of type ---this list is used to hold the leads that needs to be converted Query the lead Status Isconverted=true(where condition)[ id,Masterlable, should be fetched] iterate For( i=0;-declared at the top } //create Database.LeadConvertResult[] array—Shown below [you can use exact line shown below] Database.LeadConvertResult[] leadResult= Database.convertLead(pass the listOfleads that needs to be converted,false); //itereate the leadResult and check the system.debug to know the success or failure
What behavior are you after in the lead conversion process that isn't already done by the convert lead feature in the UI? Is it that you want certain leads to be auto converted upon creation?
Also, could you please format your code? It is very difficult to read! Use the "Insert Code" button on the editor. Thanks!