Typically if there is a standard field that ends in "Id", you can access the reference (and thus the fields associated with that reference) by leaving off the suffix. For example, you can get the CreatedById
value (which would be treated as an Id type in code that can be casted to a String, or simply a String if referenced via an apex:outputText
tag), or the name of that user with CreatedBy.Name
.
You can also use an apex:outputField
tag on an Id (such as Opportunity.AccountId
to display the name of an opportunity's parent account) to show the reference's Name
field with a nifty built-in hover box (see herehere).
For this particular example, give this a shot:
<apex:outputText value="{!comment.Parent.CaseNumber}" />