You need to sign in to do that
Don't have an account?
Tarun Suri
while converting lead i dont want to create a contact just want account and optional opportunity
my requirement is when we convert a lead we usually get new account, new contact and ooportunity but i dont want to create contact. so am trying to achieve this through trigger on lead before update but its not working for me . can anyone help me to write a trigger on this requiremnet. here is what i have written which is not working.
trigger NoContact on Lead (before update) { list<lead> newlead = trigger.new; list<contact> conlead=new list<contact>(); for(lead lead1:newlead){ if(trigger.new.size()>1){ if(trigger.old[0].isconverted==false && trigger.new[0].isconverted==true){ if (Trigger.new[0].ConvertedContactId != null) { contact con= new contact(Id=newlead[0].ConvertedContactId); conlead.add(con); system.debug('conlead :' +conlead); } } } } delete conlead; }
Instead trying to avoid the Contact creation, have you thought about deleting the contacts created on lead conversions? you could identify those leads with a new custom field in lead and contact and map them so that when a contact is created and has this field checked, you delete it with a batch for example.
Regards