1 réponse
HI PLease find the below code for same, where you can change for same condition and proceed accordingly.
Please refer above code and let me know if that helps or you face any issue.UTrigger on Lead (before insert, before update)
{
list<Task> lsLeadToInsert = new list<Task>();
if(trigger.isInsert() && Trigger.isAfter())
{
for(lead objlead : trigger.newmap)
{
if(objlead.email != trigger.oldmap.get(objlead.Id).email)
{
Lead objLead = new Lead();
objLead.status = '';//or qassign any value which you wnat to set and then insert
lsLeadToInsert.add(objLead);
}
else
{
//then do whatever you want to update on same insteance
}
}
insert lsLeadToInsert
}
}
Thanks,
Sandeep