Campaign Influence - Prompt Users to Select - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Chris MacDuffChris MacDuff 

Campaign Influence - Prompt Users to Select

Hi All,

I am aware of the limitations and quirks about how the primary Campaign is selected on an Opportunity when a Lead is converted or when an Opportunity is created from the Contact page. I have attempted to use a combination of Flow and Visualforce  to prompt the user to select the Campaign prior to the Opportunity being created, however I have hit further limitations with the Campaign Influence not being available to the API.

Approach 1:
The user selected the Primary Campaign Source (PCS) in Flow, the Flow updates the Opportunity's PCS with the selected Campaign.  I am using the convert lead class from the Flow examples. Issue: The Campaign is associated to the Opportunity twice, affecting reporting.

Approach 2:
The user selects the desired Campaign in Flow, Flow updates the PMS on the Opportunity then adds the Contact (not using the above class and manually creating the Opportunity. Campaign Influence and Contact Role). Issue: Can only have one influencing Campaign, losing reporting.

Am I missing something, or while we do not have API access to the Campaign Influence object we can't do anything about this? Both of my approaches above impact upon reporting which I don't think is acceptable. If any else has any other ideas or approaches please let me know!

Extra info:

For those unaware if the Lead/Contact is associated to multiple Campaigns, Salesforce will make the the last Campaign the Lead/Contact was associated to the Primary Campaign Source of the Opportunity.

Convert Lead class was taken from the visual workflow sample pack on the appexchange:
Marija JovanovicMarija Jovanovic
Hello Girbot,

I would like to assist but I do require some additional information.  While you have included a lot of detail here, I am still not certain what is the desired end result and how you hope to see this process work.  If you can tell me a bit more about the user case here and how you hope this works, I can definitely try to come up with some suggestions for you.
Chris MacDuffChris MacDuff
Hi Marija,

Thanks for responding.

Basically the approach I was investigating was to make the user select which Campaign to use as the PCS, if more than one is associated to the Lead/Contact. Salesforce automatically makes the last Campaign the PCS, which for us is more often than not going to be incorrect. I would like to provide the user a list of Campaigns to mark as the PCS at the point of the Opportunity being created.

I was looking at overriding both the convert button for Leads, and the New Opportunity button on Contacts with a VF/Flow page. However as we cannot access the Campaign Influence object via the API I cannot update/create a Campaign Influence, except by using the PCS field - which has the results detailed above, neither of which are an option due to the impact on reporting.

I hope that additional information helps make it clearer.