function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AJFAJF 

Case "Internal Comment" field on VF page.

I am creating a VF page that will allow users to enter information in a form that is related to a case. Once all relevant information is entered, users can also change the case owner (if required) before clicking Save and I have managed to do this successfully.

 

However, I would also like the form to be able to accept an optional "Internal Comment", so that all of the case updates can occur on one screen. However, I can't seem to find the relationship for this field. I tried multiple variations of <apex:inputfield value="{!Case.CaseComments__r.Comments}" />but without success. Can anyone help?

 

Thanks.

Best Answer chosen by Admin (Salesforce Developers) 
Pault.ax256Pault.ax256

Hi,

 

You won't be able to do what you want with an inputField here.  Your syntax assumes that there is one of these related to case.  In fact Salesforce puts these comments in the CaseComments objects and there are many of these possible per case.

 

So if you take the comment in an inputText element and put it in 'CaseComments', setting the 'parentId' to your Case you should be fine.

 

I hope this helps!

All Answers

Pault.ax256Pault.ax256

Hi,

 

You won't be able to do what you want with an inputField here.  Your syntax assumes that there is one of these related to case.  In fact Salesforce puts these comments in the CaseComments objects and there are many of these possible per case.

 

So if you take the comment in an inputText element and put it in 'CaseComments', setting the 'parentId' to your Case you should be fine.

 

I hope this helps!

This was selected as the best answer
AJFAJF

Pault, thanks for the helpful information. I'm not exactly sure how to implement your suggested solution so I would appreciate some guidance. Do I need to create a controller extension or can I just use markup?

 

Thanks.