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
studiopikastudiopika 

Most Recent Activity in Lead

 

How should I write in apex to retrieve the most recent activities (both open and history) related to a lead?

I'm hoping to wrap that information with other fields in a lead object to return to a V.F. to display as a list.

 

Thank you for all your input.

bob_buzzardbob_buzzard

That should just be a matter of a couple of SOQL queries ordered by the due date of the activity with a limit of the number of recent activities you want to show.  Are you having specific issues?