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
Mattias NordinMattias Nordin 

How do you execute an apex trigger on lead convert?

How do you execute an apex trigger on lead convert?

I noticed that a lead convert is not an edit action.

 

Thanks

Mattias

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard
When a lead is converted, its status will be updated to a picklist value where the converted checkbox is ticked.  Thus you'd want a trigger on a lead update that only takes any action if the status value changes from an unconverted option to a converted option.

All Answers

bob_buzzardbob_buzzard
When a lead is converted, its status will be updated to a picklist value where the converted checkbox is ticked.  Thus you'd want a trigger on a lead update that only takes any action if the status value changes from an unconverted option to a converted option.
This was selected as the best answer
jkucerajkucera
You can check trigger.new for IsConverted==True in an update trigger. Note you can't change the lead in the after insert trigger, so if you want to change anything use a before insert trigger.