+ Start a Discussion
❤Code❤Code 

How to add field history as a related list of opportunity in vf page

I am trying the below code to add field history as a related list of opportunity in vf page, but its not working .
 
<apex:relatedList list="OpportunityFieldHistory"/>


Can anyone tell me what is the correct way to write it.
Regards
 
GauravGargGauravGarg
Hi ,

Please use below code:

<apex:relatedlist list="OpportunityHistories" title="Opp History"/>

I tried the same in my org it was working.

Thanks,
Gaurav
Dutta SouravDutta Sourav
Try This:
<apex:page standardController="opportunity">
    <apex:form>
        <apex:detail id="detail" inlineEdit="true" relatedList="true" relatedListHover="true" subject="{!Opportunity.Id}" title="true" />
    </apex:form>
</apex:page>

 
❤Code❤Code
I am not using detail tag... Can u please suggesst me apart from detail tag...
Swaraj Behera 7Swaraj Behera 7
Try this
 
<apex:page standardController="opportunity">
 <apex:relatedlist list="OpportunityHistories" title="Stage History"/>
 <apex:pageBlock >
 <apex:pageblocktable value="{!opportunity.Histories}" var="hist" title="opporty">
 <apex:column value="{!hist.createddate}"/>
 </apex:pageblocktable>
</apex:pageBlock> 
</apex:page>

 
Swaraj Behera 7Swaraj Behera 7
It works perfectly fine for me
Thanks