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
Willis RayWillis Ray 

Need coding example of how to add activity history (edit/view) to a custom VisualForce Lead page as on standard SF Lead page.

I am relatively new to SF development. I have created a custom VisualForce lead page. I need to add activity list for the lead, with the ability to view / add to that activity list for the lead as is possible on the standard SF lead page. I have searched this forum and the web, but not found exactly what I need and would like an example if possible to put the pieces together. Thanks!
Shun KosakaShun Kosaka
Hi Willis,
<apex:relatedlist> tag can show the activity list.
<apex:page standardController="Lead">
  <apex:relatedList title="Open Activities" subject="{!Lead}" list="OpenActivities" />
  <apex:relatedList title="Activity History" subject="{!Lead}" list="ActivityHistories" />
</apex:page>
Check with a lead id in your org like below.
Example : http://..../apex/YourPageName?id=00Q2800000OM4TK