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

Event History Related list for a custom object

Hi guys, 


I created a visual force page that replaces view of a custom object. I now have tabs ....


My question is the following:


Lets say I have a custom object called X. How can I get a tab to display the "Event History" tab of this object ? I want to be able to view the field changes - which is in that related list? 


Thanks a mil




PS: The code for my view update is as follow:


<apex:page standardController="Trading_Contract__c" showHeader="true">

.activeTab {background-color: #236FBD; color:white; background-image:none}
.inactiveTab { background-color: lightgrey; color:black; background-image:none}

<apex:tabPanel tabClass="activeTab" inactiveTabClass="inactiveTab"
switchType="client" selectedTab="tabdetails" id="AccountTabPanel">
<apex:tab label="Main Contract Details" name="contractDetails" id="tabdetails">
<apex:detail inlineedit="true" relatedList="false" title="true"/></apex:tab>

<apex:tab label="Intermediary Agreements" name="intermediaryagreements" id="intermediaryagreements">
<apex:relatedList list="TC_Intermediatries__r" />

<apex:tab label="Related Shipments" name="shipments" id="shipments">
<apex:relatedList list="TC_SH__r" />

<apex:tab label="Related Certificate Trades" name="certificatetrades" id="certificatetrades">
<apex:relatedList list="cert_trading_related_to_contract__r" />
<apex:tab label="Related Letter of Credits" name="contractletterofcredits" id="contractletterofcredits">
<apex:relatedList list="Letter_of_Credits__r" />

<apex:tab label="Open Activities" name="OpenActivities" id="tabOpenAct">
<apex:relatedList subject="{!Trading_Contract__c}" list="OpenActivities" />
<apex:tab label="Activity History" name="activityHistory" id="tabAH">
<apex:relatedList list="ActivityHistories" />

<apex:tab label="Notes and Attachments" name="NotesAndAttachments" id="tabNoteAtt">
<apex:relatedList subject="{!Trading_Contract__c}" list="NotesAndAttachments" />

<!--<apex:tab label="TC_Intermediatries" name="TC_Intermediatries__r" id="tabIntAgmts">
<apex:relatedList subject="{!Trading_Contract__c.TC_Intermediatries__r}" list="IntermediaryAgreements" />




So if I'm reading this correctly, you are looking to show the <object> History entries - i.e. the tracked field changes for the object?


According to the schema explorer you should be able to use an <apex:relatedList> component, with the list attribute set to "Histories".  Unfortunately when I try this I receive an error.


There's a thread with code to roll your own history list if that's any use at:


Thanks Bob...will take a look at it