3

I have page which uses contact standard controller which is as below

<apex:page standardController="contact">
    {!contact.account.name}
</apex:page>

When I pass a valid id for contact it displays related account name, without any error.

In the Salesforce quickstart documentation for Displaying Field Values with Visualforce: http://www.salesforce.com/us/developer/docs/pages/Content/pages_quick_start_display_field_values.htm

Note: You cannot access parent objects using this expression language. In other words, {!account.parent.name} will return an error.

As per this, my code was supposed to throw an error. Why that did not happen?

8
  • You aren't very clear as to what you are asking. Are you saying that you get that error, or are you asking why you aren't getting that error?
    – dphil
    Commented May 21, 2014 at 14:46
  • edited query ..hope its more clear now
    – sfdc99999
    Commented May 21, 2014 at 14:48
  • I don't see anything in that document that says it should throw an error. It makes sense that what you are putting in there could work.
    – dphil
    Commented May 21, 2014 at 14:53
  • ok..so then what does this mean by?You cannot access parent objects using this expression language. In other words, {!account.parent.name} will return an error.
    – sfdc99999
    Commented May 21, 2014 at 14:54
  • 4
    More to the point, Visualforce has supported this syntax for many releases, so I ponder when this verbiage made it into the docs.
    – sfdcfox
    Commented May 21, 2014 at 15:36

1 Answer 1

2

I've confirmed that the code works as described. sfdcfox notes that this syntax has worked for many releases. I'd say the answer is that the documentation has not been updated.

1
  • Someone should report the inaccuracy using the feedback widget at the bottom of the documentation page. (if they haven't already)
    – Mark Pond
    Commented May 21, 2014 at 17:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .