Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Salesforce by (11.9k points)

I'm trying to create a Visualforce page with a number of related lists. I'm trying to display the same related lists that I have on the standard layout page. OpenActivities, ActivityHistories, Attachments, and CaseSolutions all work fine.

However, when I try to add EmailMessages I get the following error.

Visualforce Error

'EmailMessages' is not a valid child relationship name for entity Case

I'm able to sort of work around it by getting the email messages using some soql, but I'd really like it to be just a plain related list.

Can anyone suggest what I might be doing wrong?

1 Answer

0 votes
by (32.1k points)
edited by

For now EmailMessages related list isn't sustained in <apex:relatedlist> Though, you don't certainly have to use SOQL to form an unfiltered list, you can point emphasizing element's value to draw data immediately from the relationship:

<apex:dataTable value="{!Case.EmailMessages}" var="email">

    <apex:column value="{!email.Subject}" />

    ...

</apex:dataTable>

Want to learn Salesforce in depth? Go through the Salesforce Training provided by Intellipaat! 

Browse Categories

...