You need to sign in to do that
Don't have an account?
swimmingly
Sites Visualforce Component to Create Case Comment
I'm looking for help with creating a component that will allow for adding a comment to an existing case.
Keep getting compile errors, I'm trying something like this:
<apex:form>
<apex:inputTextarea id="statusUpdate" value="{!comment.CommentBody}" rows="8" cols="100"/>
</apex:form>
Any suggestions much appreciated. I think I'm finding this harder than it really is, but I'm being thrown by the fact that I need this to run on a Force.com Sites Page -- a Visualforce page not on Sites can simply call the URL for new comments, something like this:
https://naX.salesforce.com/00a/e?parent_id=50050dd000XXXXX&retURL=%2F50050dd000XXXXX&CommentBody='This test comment'
It should probably be {!CaseComment.CommentBody} instead. You should never use an "internal URL" directly in the manner you propose. You should always use URLFOR if you must use a URL (see Help for details on URLFOR), or preferably create records using your controller.
All Answers
It should probably be {!CaseComment.CommentBody} instead. You should never use an "internal URL" directly in the manner you propose. You should always use URLFOR if you must use a URL (see Help for details on URLFOR), or preferably create records using your controller.
Thanks for the suggestion, sfdcfox, but I get an error:
Error: Unknown property 'CaseStandardController.caseComment'
You suggested a custom controller, but shouldn't I be able to do this with a standard controller? I'm new to Apex and can't make my custom controller work either, but then I wondered why I couldn't even make the standard controller work.