Cross-object formulas
We've seen so far that a formula works by using functions, expressions, operators, literal values, and object fields. What if we need to access the account's fields when we are creating a custom formula field on the Case
object or we are implementing a validation rule on the Campaign Member
object but we need the Campaign
details?
We'll use the so-called cross-object formulas: they allow us to reference parent object fields to be used as a merge field on a formula—it is possible to go back to an object ancestor up to 10 relationships away. So, for example, if we are creating a formula field on the Case object, we can access the following:
Case
fieldsCase.Contact
fieldsCase.Contact.Account
fieldsCase.Contact.Account.Owner
(User) fields
If the parent object we want to access is available through a standard relationship field, simply use the relationship field name followed by a dot followed by the field you...