You need to sign in to do that
Don't have an account?

How can I get a list of case comments using a custom controller
I am trying to use a custom controller to get back case comments for a particular case (case id will be in URL). I need to do this so I can sort columns (very annoying that Salesforce doesn't allow this with dataTables). Right now I'm just trying to get some data back from my controller and failing miserably.
How can I do this?
So far this doesn't work....
****My test VF page****
How can I do this?
So far this doesn't work....
****My test VF page****
<apex:page standardController="Case" extensions="TestController"> <apex:form > <apex:pageBlock title="{!Case.CaseNumber}"> TEST:{!caseComm[0].CommentBody} </apex:pageBlock> </apex:form> </apex:page>***My test controller***
public class TestController { public List<Case> caseComm {get;set;} public TestController(ApexPages.StandardController controller) { } public List<Case> caseComm() { List<Case> comments = [Select (Select Id, ParentId, IsPublished, CommentBody, CreatedById, CreatedDate, LastModifiedDate, LastModifiedById, From CaseComments) From Case ]; return comments; } }
I think you need to add the
Public list<CaseComment> getCaseCommentList()
{
return caseCommentList;
}
Refer the below code,
Thank You,
Rajesh Adiga P.
All Answers
I think you need to add the
Public list<CaseComment> getCaseCommentList()
{
return caseCommentList;
}
Refer the below code,
Thank You,
Rajesh Adiga P.
Try the code given below,
vf page:
controller:
Thanks,
Pinky
This works perfectly for what I am trying to do.
Thanks again!
Thank You,
Rajesh Adiga P.