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 

I am Sakthivel Madesh, a certified Salesforce Advanced Developer & Administrator working on Salesforce Technology since 2011. I am currently working in Techforce Services as Sr. Salesforce Developer. I have worked on multiple technologies Like PHP, Java, Salesforce, I am very passionate about Salesforce and to earn 15x Salesforce Certification. I love Trailhead for learning Salesforce Skill and Become a Trailhead 5x Ranger too. I Love to Learn & Share my Salesforce knowledge to Salesforce Learners/Beginner using My Blog and Salesforce Community.

Leave a Reply

Your email address will not be published. Required fields are marked *