subscribe our youtube channel popup

What Are Cross-Object Formulas in Salesforce?

Let’s say you’re looking at a Case record in Salesforce, and you want to show the Account Name or the Industry of the related Account directly on the Case page. You don’t want users to click around to find that information. That’s where cross-object formulas come in.

They help bring data from one object into another — as long as those two objects are connected.

What Is a Cross-Object Formula?

A cross-object formula lets you pull in data from a related object in Salesforce. For example:

  • A Case is linked to an Account.
  • A Contact is linked to an Account.
  • A Job Application is linked to a Position (custom object).

Using a formula field, you can show a field from the related object, like Account.Name or Position__r.Title__c — without needing any automation or code.

How Do Cross-Object Formulas Work?

They work when objects are connected by lookup or master-detail relationships. You can reach across objects and reference fields using a simple dot notation:

Contact.Account.Industry

This means: start at the Contact, go to the related Account, and get the Industry field.

If you’re using custom objects, Salesforce uses __r in the relationship name. 

For example:

Job_Application__c.Position__r.Title__c

That pulls the Title from the related Position record.

Where Can You Use Them?

You can use cross-object formulas in:

  • Formula fields
  • Validation rules
  • Workflow rules
  • Approval processes
  • Assignment rules
  • Auto-response rules
  • Escalation rules

But you can’t use them when setting a default value on a field.

How Many Relationships Can You Cross?

Salesforce allows you to cross up to 10 relationships in total. That means you can reference related records up to 10 layers deep.

Keep in mind: the 10-relationship limit is shared across all formulas, rules, and filters on the same object.

Some Important Notes

1. Access to Fields

If you display a cross-object formula field on a layout, users can see the data even if they don’t have direct access to that related record. For example, if a Case formula shows Account.Industry, users can see that value on the Case — even if they don’t have permission to view the Account record.

2. You Can’t Use All Fields

Some fields don’t work in formulas:

  • Polymorphic fields, like OwnerId, need extra handling.

Fields like Owner.Name can give errors. Instead, use:


Owner.FirstName & ” ” & Owner.LastName

3. Owner Field Handling

Sometimes the owner of a record might be a User or a Queue. If you’re writing a formula, you need to tell Salesforce which one to check. Here’s an example:

IF(  ISBLANK(Owner:User.Id),  Owner:Queue.QueueEmail,  Owner:User.Email)

This means: if the owner is a Queue, show the Queue’s email. Otherwise, show the User’s email.

Example Formula

Let’s say you want to show the Account Name on a Case. You’d write:

Account.Name

If you’re going deeper, for example, Case → Contact → Account → Name:

Contact.Account.Name

And for custom objects:

Candidate__r.Position__r.Title__c

A Quick Note on Profile.Name

When you use Profile.Name in a formula, it can behave differently depending on where you use it.

  • On a detail page: it shows the Profile name.
  • In a report or list view: it might show an internal value.

To handle this, use something like:


IF(  OR(    LastModifiedBy.Profile.Name = “Standard User”,    LastModifiedBy.Profile.Name = “Support Agent”  ),  “Standard”,  “Other”)

Final Thoughts

Cross-object formulas are a simple feature in Salesforce. They let you display useful information from related records without writing code or duplicating data. You just need to know how objects are connected and how to write the relationship path.

They help make your pages smarter, reduce clicks, and improve the user experience — all with just a few lines in a formula field.

One comment

  1. Had trouble in the past with polymorphic fields. What do you mean by “extra handling”? Apex? That’s the route I had to go but wondering if you have an easier route

Leave a Reply

Your email address will not be published. Required fields are marked *