在案例的 Visualforce 页面中访问电子邮件消息相关列表
我正在尝试创建一个包含许多相关列表的 Visualforce 页面。我正在尝试显示与标准布局页面上相同的相关列表。 OpenActivities、ActivityHistories、Attachments 和 CaseSolutions 都工作正常。
但是,当我尝试添加电子邮件消息时,出现以下错误。
Visualforce 错误
“EmailMessages”不是实体的有效子关系名称案例
我可以通过使用某些 soql 获取 EmailMessages 来解决它,但我真的希望它只是一个简单的相关列表。
谁能建议我可能做错了什么?
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 EmailMessages 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不幸的是,没有,这是普通民众从未充分投票支持实施的事情之一。目前
不支持EmailMessages
相关列表,不过,您不一定必须使用 SOQL 来生成未过滤的列表,您可以点迭代元素的值直接从关系中提取数据:Unfortunately no, its one of those things that the general population never upvotes sufficiently to get implemented. For now
EmailMessages
related list is not supported in<apex:relatedlist>
Though, you don't necessarily have to use SOQL to generate an unfiltered list, you can point iterating element's value to draw data directly from the relationship:下面是一个更完整的示例,它将 apex:repeat 与 HTML 表一起使用。这种方法允许您调整行之间的间距。它还包括 ReplyToAll 操作。我计划通过更多操作来扩展此示例,并将更多信息放入电子邮件信息列中。
Here is a fuller example that uses apex:repeat with a HTML table. This approach allows you to adjust the spacing between rows. It also includes a ReplyToAll action. I plan on extending this example with more actions and put more information in the email info column.