function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
admin sureshadmin suresh 

what is self relationship and what is difference b/w self and heirachy relationship?

PratikPratik (Salesforce Developers) 
Hi Suresh,

Hierarchy relationship is only for User object.

Hierarchical Relationship:
This type of relationship is a special lookup relationship available only for the user object. It allows users to use a lookup field to associate one user with another that does not directly or indirectly refer to itself. For example, you can create a custom hierarchical relationship field to store each user's direct manager.

Self Relationships:
You can create a relationship from an object to itself, but it must be a lookup relationship, and a single record can't be linked to itself. However, a record can indirectly relate to itself.


P.S. If this answers you question, please mark it as "Best Answer" so it will help other community members too.
Krishnakanth Pamu 1Krishnakanth Pamu 1
Hi Pratik..

Small Modification in the Self Relationship... that is It CANNOT DIRECTLY OR INDIRECTLY RELATE TO SAME OBJECT.