Field Track Histories through apex

<apex:pageBlock title="Track History" >
<apex:pageBlockTable value="{!Student__c.histories}" var="accountHistory" width="100%">
<!-- Displays Created Date of the Field History -->
<apex:column headerValue="Date" >
<apex:outputText value="{0,date,MM/dd/yyyy HH:mm }">
<apex:param value="{!accountHistory.createddate}" />
</apex:outputText>
</apex:column>
<!-- Displays the corresponding field -->
<apex:column headerValue="Field">
<b> <apex:outputText value="{!IF(CONTAINS(accountHistory.field,'__c'),LEFT(accountHistory.field, LEN(accountHistory.field) -3),accountHistory.field)}"/></b>
</apex:column>
<!-- Displays Edited By User -->                        
<apex:column headerValue="Edited By">
<apex:outputText value="{!accountHistory.createdby.name}"/>
</apex:column>
<!-- Displays Old value of the field -->
<apex:column headerValue="Old Value">
<apex:outputText value="{!accountHistory.oldvalue}"/>
</apex:column>
<!-- Displays New Value of the field -->
<apex:column headerValue="New Value">
<apex:outputText value="{!accountHistory.newvalue}"/>
</apex:column>
</apex:pageBlocktable>
</apex:pageBlock>   

Comments