Skip to main content
replaced http://salesforce.stackexchange.com/ with https://salesforce.stackexchange.com/
Source Link

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}" />

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 here).

For this particular example, give this a shot:

<apex:outputText value="{!comment.Parent.CaseNumber}" />

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 here).

For this particular example, give this a shot:

<apex:outputText value="{!comment.Parent.CaseNumber}" />
formatting, language, etc.
Source Link
JCD
  • 3.4k
  • 2
  • 27
  • 37

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 here).

GiveFor this particular example, give this a shot:

<apex:outputText value="{!comment.Parent.CaseNumber}" />

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 with a nifty built-in hover box (see here).

Give this a shot:

<apex:outputText value="{!comment.Parent.CaseNumber}" />

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 here).

For this particular example, give this a shot:

<apex:outputText value="{!comment.Parent.CaseNumber}" />
Source Link
JCD
  • 3.4k
  • 2
  • 27
  • 37

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 with a nifty built-in hover box (see here).

Give this a shot:

<apex:outputText value="{!comment.Parent.CaseNumber}" />