Loading

Error: You cannot set a hierarchy field to point to itself or a child record

Publiseringsdato: May 5, 2026
Beskrivelse

In Salesforce, you may encounter the following error when editing or saving a record:

"You cannot set a hierarchy field to point to itself or a child record."

This error occurs when a lookup or hierarchy field on a record is configured to reference itself or one of its child (downstream) records, creating a circular or recursive relationship. Salesforce prevents this to avoid infinite loops in record hierarchy structures.
Common scenarios where this error appears include:

  • Merging Account records where a custom lookup field creates a circular reference
  • Configuring User hierarchy fields (such as a custom Manager field) that create circular reporting chains
Løsning

Scenario 1: Merging Accounts with a Circular Lookup Field

This error can occur when merging two Account records when a custom lookup field on the Account object points back to another Account:

  • Account A has a custom lookup field that points to Account B.
  • On the Merge Accounts wizard, the user selects Account B as the master record and retains the old value from Account A's lookup field (which points to Account B).
  • After the merge, Account A is deleted and Account B is kept. However, Account B's lookup field now points to itself, which triggers the error.

Resolution: Before merging, update the custom lookup field on the non-master record so that it does not point to the record being selected as the master. Save the change, then proceed with the merge.

Scenario 2: User Hierarchy Field Circular Reference

This error can also occur when configuring a custom User hierarchy field (for example, a field called "Manager") when the assignment creates a circular chain.
Example:

  • User A reports to User C (User C is User A's Manager)
  • User C reports to User B (User B is User C's Manager)
  • If you attempt to set User A as the Manager for User B, Salesforce will throw this error because User B would become the manager of User C, who is already the manager of User A — creating a circular chain.

Resolution: Before saving, ensure the user hierarchy field assignment does not create a loop. Review the existing hierarchy chain for the record before making changes.

Knowledge-artikkelnummer

000385626

 
Laster
Salesforce Help | Article