Every standard controller includes a getter method that returns the record specified by the
id query string parameter in the page URL. This
method allows the associated page markup to reference fields on the context record by using
{!object} syntax, where
object is the lowercase name of the object associated with the
controller. For example, a page that uses the Account standard controller can use {!account.name} to return the value of the name field on the account that is currently in context.
As with queries in the Lightning Platform API, you can use merge field syntax to retrieve
data from related records:
- You can traverse up to five levels of child-to-parent relationships. For example, if
using the Contact standard controller, you can use {!contact.Account.Owner.FirstName} (a three-level child-to-parent
relationship) to return the name of the owner of the account record that is
associated with the contact.
- You can traverse one level of parent-to-child relationships. For example, if using
the Account standard controller, you can use {!account.Contacts} to return an array of all contacts associated with
the account that is currently in context.