2

I am new to Salesforce development and trying to resolve an issue i have come across. Any inputs are highly Appreciated.

I have developed a custom visual force page for the Opportunity details and i want to display a Opportunity Field History Related list. I used the Following Apex tag to display the code, but Its showing " Histories is not a valid child relationship name for entity Opportunity". Can you please let me know what the issue is?

 <apex:relatedlist list="OpportunityTeamMembers" title="Opportunity Team"/>
 <apex:relatedlist list="Histories" title="Opportunity Team"/>
 <apex:relatedlist list="OpportunityHistories" title="Stage History"/>
 <apex:relatedlist list="Contracts__r" title="Contracts"/>

Thanks.

3

Histories is a special related list you need to build it using or or

<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>
  • Thanks a lot, this Is working perfectly. made my day. Since morning trying to figure out how to solve this :) – Phani Mar 12 '14 at 22:58
  • Does this work for Assets as well? – user24887 Sep 22 '15 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.