You need to sign in to do that
Don't have an account?
Sureka
How to display field label in History related lists in visualforce
Hi All,
I am using the below code to display History related lists in visualforce.
<apex:dataTable value="{!Object.histories}" var="history" rowClasses="odd,even" cellspacing="15" width="100%">
<apex:column >
<apex:facet name="header"></apex:facet>
<apex:facet name="footer"></apex:facet>
<apex:outputText value="{0,date,MM/dd/yyyy HH:mm }">
<apex:param value="{!history.createddate}" />
</apex:outputText>
</apex:column>
<apex:column >
<apex:facet name="header">Field</apex:facet>
<apex:facet name="footer"></apex:facet>
<b> <apex:outputText value="{!history.field}"/></b>
</apex:column>
<apex:column >
<apex:facet name="header">Editied By</apex:facet>
<apex:facet name="footer"></apex:facet>
<apex:outputText value="{!history.createdby.name}"/>
</apex:column>
<apex:column >
<apex:facet name="header">Old Value</apex:facet>
<apex:facet name="footer"></apex:facet>
<apex:outputText value="{!history.oldvalue}"/>
</apex:column>
<apex:column >
<apex:facet name="header">New Value</apex:facet>
<apex:facet name="footer"></apex:facet>
<apex:outputText value="{!history.newvalue}"/>
</apex:column>
</apex:datatable>
But in "Field" column, its displaying API name of the field. Is there a way to display field label instead of API Name?
Or can u suggest any other way to display History related lists with standard controller(without Apex).
Thanks
Sureka
One way to do that is to use dynamix Apex. The following code is an eg:
However, this has to be done in Apex Class. So you will have to first store the data in a wrapper class.
Also, if you want to generate a history related list like the way standard salesforce does, you can check the following post
http://boards.developerforce.com/t5/Visualforce-Development/History-related-List-using-Visualforce/m-p/156208/highlight/true