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

Case comment: make "public"-checkbox required

I'd like all our case comments to be marked as public (as I have a workflow rule linked to this object that only fires if the "public"-checkbox is marked..).


Apparantly it is not possible to get the checkbox marked at the very moment the user creates the case comment (link).


However, is it possible to make the "public"-checkbox required, so that users always have to mark it?



Thanks in advance.


You can create an workflow on case comments that will fire an Field update on the "Public"checkbox.


  Rule Criteria:  ("Public" checkbox's API name is "IsPublished" and name is "Published" although label is "Public")

NOT( IsPublished = true)


 Field Update


  Set "Published" field to true.


Hope this helps




I already use a similar field update, but this will only mark the checkbox AFTER the case comment is saved (which will not fire my workflow rule).


I'd like it to be checked from the moment the user clicks "new case comment" or that it would already be set as required on the page layout (as is now the case for the "comment"-field in the case comment page layout)


As of now, there is no flexibility to customize Case Comments except the trigger.


Hence a before insert trigger can be coded to check for this value and if not checked throw an error in UI. This is as good as making it required functionally.


Another suggestion would be to create a detail case button of type url, labelled "Create Case Comment"  having url as




Above will open an case comment edit page with public ticked.

Of course we cannot make any changes to case comment related list in case page layout. Hence there will be two "New Case Comments" button.


Thx Sarge! That's a good idea.


Unfortunately I have no experience at all with coding or triggers..

Could you please help me out with this or is that not possible for you?


Hi. Triggers are no simple thing if you're new to programming. Here is a starting point for working with triggers:  Check "Invoking Apex" - "Triggers".  Be sure to pay special attention to the "Bulk Triggers" section.





try Validation rule for checkbox field rather than trigger


Hi desidsk,


Unfortunately it is not possible to create validation rules on the "Case Comment"-object (field "IsPublished")


I hope I'm not misreading your post about implementing Sarge's solution, but it sounded like you were looking for a walkthrough on actually using his advice.  I don't know enough about triggers to provide help with that, but if you are interested in the button option I can provide that.


To add the button or link, you go to


Setup -> Customize -> Cases -> Buttons and Links


Then you click on New, and do the following:


  • Give it a Label (Which will autofill the unique name and you may change it if you want)
  • Choose if you want it to be a Detail Page Button or Detail Page Link (They go in different places based on the type)
  • Set its behavior to be "Display in existing window without sidebar or header" (Those already are in place due to the source page)
  • Leave Content Source as URL
  • Set the field to Sarge's description ("/00a/e?parent_id={!Case.Id}&retURL=%2F{!Case.Id}&I​sPublished=1") and click Save
  • Add the button or link to the page layout by going to Setup -> Customize -> Cases -> Page Layout and then selecting Buttons or Custom Links from the categories to add to the page, then dragging your new button or link onto the page at the appropriate location


For a solution I needed I also wanted users to be able to start with some text already in the comment, and Sarge told me that it can be done by adding &CommentBody= with the comment text after that, using +'s instead of spaces.  This was valuable for brief comments that we wanted always entered the same way for our customers.