Search Here

Create a duplicate lead when a lead is inserted.

 public class checkRecursive {

private static boolean run = true;

public static boolean runOnce()

{

if(run)

{

run=false;

return true;

}

else

{

return run;

}

}

}



trigger duplicateLead on Lead (after insert) {

if(checkRecursive.runOnce()){

List<Lead> leadList = new List<Lead>();

leadList = Trigger.new.deepClone();

insert leadList;

}

}

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.