A merge field’s syntax can vary depending on where you use the field. To make sure
that you use the correct syntax, select merge fields from the dropdown list in the editor
where you use the merge field.
Required Editions
| Available in: both Salesforce Classic and Lightning Experience |
| The available merge fields vary according to which Salesforce edition you
have. |
Custom objects and fields are always appended with __c when referenced. The object precedes field labels, and all spaces
convert to underscores. For example, Account.CreatedDate references the Created Date
standard field for the account object.
In standard relationships, the name of the relationship is the master object. For
example, you can reference the account name from a contact validation rule using Account.Name. You can reference the phone number of the
account creator from an opportunity product formula field using Opportunity.Account.CreatedBy.Phone. In custom
relationships, the name of the relationship is the value specified in Field
Name with __r appended to it. For
example, you can reference contact email from a custom object validation rule using
Contact__r.Email.