You need to sign in to do that
Don't have an account?

trigger to create duplicate lead
Hi All,
need to write a new trigger on lead which will check for ‘Open-Not Contacted’ Leads and then creates a duplicate entry of the same lead but with status as ‘Working – Contacted’, rest all information will be the same.
Thanks,
RudrAbhishek
<pre>
trigger LeadTrigger on Lead (before insert) {
List<Lead> lstLeads = new List<Lead>();
for(Lead l : Trigger.new){
if(l.Status=='Open'){
lstLeads.add(l) ;
}
}
List<Lead> lstDupLeads = lstLeads.deepClone(false, true, false);
for(Lead l : lstDupLeads){
l.Status='Contacted';
}
insert lstDupLeads;
}
</pre>
Regards,
Satish Kumar