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
patricialimpatricialim 

Finding a way to associating a lead to its most recent campaign only

Hello,

I'm a Salesforce newbie and had a question. I am trying to run a report to show the MOST RECENT campaign associated with a lead. For instance, if a lead received campaign A, B and C (in that order) I would like to run a report to show that the lead received C. The out of the box reports show ALL campaigns, regardless of recency.

From what I can tell, the out of the box reports can't display the data the way I want. Does anyone have any suggestions on how I might go about getting this data?

I'm thinking, when a campaign is added to a lead record, of updating a lead field called "Most recent campaign" and running a report off that. Am I overthinking this? And if this is the best way, would Apex code be the way to do this?

Any thoughts would be much appreciated.

Patricia