function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Deepak PansariDeepak Pansari 

Custom lead conversion and lead trigger

Hi ,

 

I have overrided lead convert button and then redirected to account page.

 

Now the issue here is , I have a trigger on lead after update which sends email to user , it wont fire when lead conversion process is over , But when I use standard lead conversion , then trigger gets fire.

 

So my question is does the trigger on lead will not fire if we use custom lead conversion process.

 

Regards,

Deepak Pansari

Navatar_DbSupNavatar_DbSup

Hi,


You can use the standard field of lead object i.e. isConverted and make the condition on this field that when ever this field value is false then only your trigger will fired an email. Think your trigger should be like this:
Trigger LeadConversion on Lead(after update)
{
If(trigger.new[0].isConverted == false)
{
// Put your code inside this for sending an email.
}
}

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

Deepak PansariDeepak Pansari

Hi,

 

My issue is trigger is not getting fire when we convert lead , As we are overrided the Covert button.

 

Trigger code

 

Trigger LeadConversion on Lead(after update)
{
If(trigger.new[0].isConverted == true)
{
  // My email sending code....
}
}

 

Button code:

 

Database.LeadConvert lc = new database.LeadConvert();
lc.setLeadId(myLead.id);

Regards,

Deepak Pansari