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
lnryanlnryan 

Trouble with Lead Conversion with Campaigns: Need to Prevent Opportunity Creation

Questions:

Is it possible to capture the Lead Convert information in a Before Update trigger in order to override the user's selections:for instance to unflag create opportunity option? If not, could this be integrated into a trigger on the Opportunity that could selectively prevent the opportunity creation and what's the best way to do that? a before trigger or an after trigger?

 

Context: We've extended the Campaign Management process so that customers who respond to campaign invitations through a web-form on our site reintegrated into the salesforce campaign: their status is updated and an opportunity relating to the campaign offering is created. The one problem we have with this is with Lead campaign members. These require that the sales teams convert the lead before the opportunity can be created. We've also created a lookup to the Opportunity on the Campaign Member record to work around some of the reporting limitations on Campaigns & Campaign Members.

 

When users forget to check the 'Do not create Opportunity' option, this creates a default opportunity but bypasses the customized opportunity logic we have created specifically for these campaigns. We'd like to capture the lead convert action beforehand in these cases in order to

 

jkucerajkucera

You might be better off creating a before insert trigger on Opportunity as there's not an easy way to hook into lead convert and fail specific portions of the process.

 

You can check if the inserted oppty comes from a converted lead, and if that lead is in the desired campaigns, you can fail creation of the oppty.