Find your content:

Search form

You are here

CaseComment and CaseHistory relatedlist in visualforce page

 
Share

I want to add CaseComment and CaseHistory related list to my visualforce page.

<apex:relatedList list=" " />

What should be the value for List attribute in the code defined above. When I added

<apex:relatedList list="CaseHistory" /> 'Histories' is also not working

<apex:relatedList list="CaseComment" /> 'CaseComments' is also not working

I get errors saying they are not valid child relationship name for entity Case.

Please help me out on this issue.


Attribution to: NoNicknameSFDC

Possible Suggestion/Solution #1

I tried with this and works for me.

  <apex:pageBlock>
        <apex:pageBlockTable value="{!case.casecomments}"var="c">
            <apex:column value="{!c.commentbody}"/>
        </apex:pageBlockTable>
        <apex:pageBlockTable value="{!case.Histories}" var="c">
            <apex:column value="{!c.OldValue}"/>
            <apex:column value="{!c.NewValue}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>

Attribution to: Piyush

Possible Suggestion/Solution #2

I suggets you create own history related list. You can refer this link


Attribution to: Piyush

Possible Suggestion/Solution #3

You can do this through custom controller. Please refer this link. Case History


Attribution to: Allwin
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/32626

My Block Status

My Block Content