[SalesForce] Show case emails related list on custom object page layout

I am trying to create a Visualforce page to be displayed inline on a custom object page layout (Project__c) so that I can display a list of case emails on the case for the case related to the project.

The metadata tells me that the relationship name is "EmailMessages", so I created the following Visualforce page:

<apex:page standardcontroller="Project__c" showHeader="false" sidebar="false">
    <apex:relatedList list="EmailMessages" subject="{!Project__c.Case__c}"/>
</apex:page>

However when I view the page I get:

   Content cannot be displayed: 'EmailMessages' is not a valid child relationship name for entity Case

Wondering if anyone else has run across this and knows of the correct relationship name or a workaround other than having to manually replicate this related list?

Best Answer

Oftentimes, this is caused by the user not being able to access this object or if this related list is not currently displayed on the page layouts. This type of syntax might help:

Also, if users have overridden the standard page layouts to remove a related list, this can cause an issue. Make sure to override all users' customizations for this related list.

Related Topic