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
Abhi_TripathiAbhi_Tripathi 

Account History related List

Hi all,

I want to display Account History as a related list in Visual force page. I am trying below syntax

<apex:page standardController="Account">
        <apex:relatedList list="AccountHistory"/>
</apex:page>

But it is giving error as 'AccountHistory' is not a valid child relationship name for entity Account '

Please let me know the correct syntax of API name for account history to display it as a related list.

Best Answer chosen by Admin (Salesforce Developers) 

All Answers

RockzRockz

Hi..

 

Hope this will help :

 

http://boards.developerforce.com/t5/General-Development/Need-Help-Createing-Account-History-Tab-for-Tabbed-Account-View/td-p/281197

 

https://success.salesforce.com/ideaView?id=08730000000711GAAQ

 

http://salesforcedeveloperblog.blogspot.com/2011/05/history-related-lists-in-visual-force.html

 

 

Please accept my answer as a solution if my solution was helpful. This will make it available to others as a proper answer. If you felt that I went above and beyond please give me Kudos by clicking on on the star icon.

 

Thanks,

Cool Sfdc

SeAlVaSeAlVa

Hello Abhi, 

 

the relatedList name is "Histories", but salesforce will not let you use it right away, you will need to iterate over it. 

Take a look at /t5/Visualforce-Development/How-to-display-Contact-history-Related-List-in-Visual-force-page/td-p/433349

 

The solution to the post above is for Contact, but can easily adapted.

 

Regards.