Reply
Contributor
jensenaxel
Posts: 6

Lead Conversion trigger

Hi, 

 

I was wondering if it was possible to create a trigger to check to see if the "Do not create a new opportunity upon conversion." is checked on the Convert Lead page... 

 

I would like to not have to re-create the whole page over, as well as the email functionality, it would be nice to just be able to check to see if that box was checked in a trigger... (does it store that particular field in the Lead Object that is in the trigger.new on before update? if so does anyone have any clue what the lead."key" name is?

 

any help would be much appreciated. 

 

 

Axel Jensen 

 

Regular Contributor
CodeWizard
Posts: 19

Re: Lead Conversion trigger

Yes, it is possible to create a trigger or a validation rule to check if the "Do not create a new opportunity upon conversion" is checked or not by checking the field "ConvertedOpportunityId".

 

If you are trying to enforce a rule at the Lead conversion, you can simply write a Validation Rule on "IsConverted" and "ConvertedOpportunityId" instead of a trigger.

 

If the field "ConvertedOpportunityId" is not null then the check box is unchecked and if it is null then it means the check box is checked.

 

 

To make this work, please make sure you have this option "Enforce Validation and Triggers from Lead Convert" checked under Lead Settings.