1

I have this Account object, for the respective object we have one Activity History Related list.

I need to display the Activity history for Account object through VisualForce Page.

How can it be Achieve? i want to display same record into the visual force page. enter image description here

2 Answers 2

3

You can display the related list in a VF page using apex:relatedList tag. Following is the visualforce code to display Activity History:

<apex:page standardController="Account">
    <apex:relatedList list="ActivityHistories" title="Activity History" />
</apex:page>

Below is the output:

enter image description here

You can refer this link: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_relatedList.htm

Let me know if it works for you.

3
  • Hi Ankita, it is displaying nothing for me, though i have one record for Activity History for Account. Commented Jul 4, 2017 at 10:24
  • You need to pass the account Id in this way: For example, if 001D000000IRt53 is the account ID, the resulting URL should be: Salesforce_instance/apex/myPage?id=001D000000IRt53
    – Ankita
    Commented Jul 4, 2017 at 10:31
  • oh yes, it worked thankyou. Commented Jul 4, 2017 at 10:37
0

you need to use apex:relatedList tag

 <apex:relatedList title="Activity History"  list="ActivityHistories" />

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .