---
schema_version: "1"
id: 5143fb14e1149f7604dcf4e8a070617bd2cd79a11f3ee37159d2dd98306e01f7
title: Merge Fields for Cross-Object Formulas
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/fields_merge_fields_cross_object.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.fields_merge_fields_cross_object.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: bcc4042e63f7c5f576ed31f75f0283c747b7c94c3624193883acbf498edd0895
description: A Cross-object formula is a formula that spans two related objects and references merge fields on those objects.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# Merge Fields for Cross-Object Formulas

A Cross-object formula is a formula that spans two related objects and references merge fields on those objects.

### Required Editions

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_important.png)

Important Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Salesforce Classic</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: all editions</td></tr></tbody></table>

A merge field is a field you can put in an email template, mail merge template, custom link, or formula to incorporate values from a record.

A cross-object formula can reference merge fields from a master (“parent”) object if an object is on the detail side of a master-detail relationship. A cross-object formula also works with lookup relationships. For example, you can write a cross-object formula that references the Account Name for a contact associated with a case. In this example, you would type Contact.Account.Name in a formula on the Case object.

## Syntax and Formatting

Merge fields for formulas aren’t enclosed in curly braces or preceded by an exclamation point. Use the relationship names of the objects, not the labels. Although the relationship name is often the same as the object name, it is technically the field name of the relationship field.

To reference the parent account name from Account object, the syntax is `Parent.Name`, not `Account.Name`. When referencing a custom object, add two underscores and the letter _r_ to its name. For example, `Position__r.title__c` references the Job Title field (`title__c`) on a Position custom object.

## Limitations

You can’t reference:

- Merge fields for objects related to activities. For example, merge fields for contacts and accounts are not available in task and event formulas.
- The `$RecordType` global variable—it only resolves to the record containing the formula, not the record to which the formula spans. Starting with the Spring ’13 release, when you create a new formula the `$RecordType` global variable is only available for default value formulas.

The value of the `Profile.Name` merge field differs depending on the context of the cross-object formula field that references it. On detail pages, the value is the profile name, as expected. In list views and reports, the value is the internal value of the associated profile instead. If you use `Profile.Name` in a formula, use it within an `OR` function to ensure that the formula always returns the intended result. For example:

```
IF
     (OR
          (LastModifiedBy.Profile.Name = "Standard User", LastModifiedBy.Profile.Name = "PT2"), 
     "Standard", "Not Standard")
```

None of the above applies to profile names referenced by the `$Profile` global variable.