List of Case Comment in the related Case using Apex Visualforce

You need to build the list yourself using the raw collection of data like this in your Apex Visualforce page,

Step 1: Create a new Visualforce Page Called RelatedCaseComment
<apex:page standardController="Case">
    <apex:pageBlock >
    You're looking at some related lists for {!case.casenumber}:
        <apex:pageBlockTable value="{!case.casecomments}" var="c">
            <apex:column value="{!c.commentbody}"/>


Step 2: Create a New Case and Create a case comments in the related case(500L0000000wTxz).
Step 3: Run the URL like
with the parameter of case id, which you created.
Step 4: Now you can get the Case Comments details along with the related Case.

Written by 

3x Salesforce MVP | Platform Champion | 18x Salesforce Certified | MuleSoft Certified | 8x Trailhead Ranger | TechForce Services | Sydney | Australia

Leave a Reply

Your email address will not be published.