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

To add a Open Activity (standard related list) to a Lead VF page

Hello Friends,

I've created a visualforce page for Lead which displays basic details of the lead/prospect from where the users/ sales person can work on.

Controller class: Leadview.cls
VF page:

In this VF page I need to add the "Open Activities" related list (that is there in the standard page of Lead) with only "New Task" button added to it. When the user clicks this "New task" button, the functionality to create a Task should work as standard.

Can anyone guide me to achieve this, please?
Sumit Kumar Singh 9Sumit Kumar Singh 9
Hello Steve Altec, 

You can easily achieve it - 

1) Pass the lead id in the URL as indicated in the URL.
2) Use Apex related list - 
<apex:relatedList list="OpenActivities" title="Open Activity"/>
See the below pic - 

User-added image

Hope, this will help you. 

Sumit Kumar Singh
Roshni RahulRoshni Rahul
Hi Steve,

To get standard related list in Lead VF page,
In the VF page, add the following tag,

 <apex:relatedList list="Activity " />

Hope it works. If you have any query, you can contact me.