Loading

Salesforce Formula Error: Maximum Spanning Relationships Exceeded

Publiseringsdato: Apr 22, 2026
Beskrivelse

This article explains how to resolve the error encountered when a Salesforce formula references more than 15 objects, and how to request a limit increase for Spanning Relationships in your organization. Every object has a default limit of 15 spanning relationships (cross-object references). If you try to create a formula that references more than 15 objects, you will receive an error similar to:

"You have reached the maximum number of 15 object references on [Object Name]. You must remove at least 1 relationship(s) in order to save this [Workflow Rule/formula field/..]."

For example, a complex workflow rule on an Opportunity object referencing fields from more than 15 related objects — such as Account, Contact, Campaign, and multiple custom objects — will trigger this error when attempting to save.

The limit of 15 spanning relationships is a warning sign that the formula logic is getting too complex for the formula engine. It is strongly recommended that you explore ways to reduce or remove unused spanning relationships before requesting a limit increase.

Limit Details

Default Limit: 15 Spanning Relationships per object

Maximum Limit: 20 Spanning Relationships per object (this is the hard maximum — no further increases are available)

How to Increase:

Submit a limit increase request with Salesforce Support

Prerequisites:

Review the ways to reduce spanning relationships below before reaching out to Support. Note that increasing this limit has potential performance implications — more complex formulas with more spans may result in increased page load and formula evaluation times. The customer must review and explicitly agree to these performance caveats prior to Support making any increase.

Løsning

To increase your Spanning Relationships limit beyond the default of 15, you'll need assistance from Salesforce Support. However, before submitting a limit increase request, please explore the following options to reduce the number of spanning relationships:

Ways to Reduce the Number of Spanning Relationships

  • Are there other ways of exposing data in formula fields that could work? For example, if you need to see information on an object 1–2 levels away on an object's detail page but don't need to report on it, you could require users to hover over the lookup link to view the details.
  • Could a junction object work? If you have multiple references to the same type of object (for example, you reference 4 different contacts in formula fields, each with a different purpose), a junction object could display the referenced objects in a related list.
  • Are the references only used in validation rules? If so, you can rewrite those rules as an Apex trigger.
  • Are the references only used by one component? If so, convert that component to a trigger.
  • Does the relationship span multiple levels of a hierarchy? If you're spanning multiple levels of a hierarchy (such as parent accounts, cases, or a hierarchy of custom objects), see if it's possible to flatten the hierarchy.

Requesting an Increase

If all options above have been exhausted and you still need assistance with increasing this limit, please have a System Administrator open a case with Salesforce Support with the following information:

  1. Your Organization ID
  2. The business reason for the request
  3. Confirmation of your understanding and acceptance of the potential performance implications of increasing this limit

Important Notes:

  • This is an organization-wide limit — any increase applies to all objects across the org, not just a single object.
  • 20 is the hard maximum for Spanning Relationships and cannot be increased further.
  • Prior to Support making any change, the customer must confirm they have reviewed and agree to the performance caveats noted above.
Knowledge-artikkelnummer

000382367

 
Laster
Salesforce Help | Article