In Salesforce, standard objects like Accounts support a built-in hierarchy feature (for example, Account Hierarchy). However, for custom objects, Salesforce does not natively provide a self-referential parent-child hierarchy.
This article explains how to simulate a parent-child hierarchy within the same Salesforce custom object — for example, a hierarchy of Opportunities — by creating a separate intermediate custom object that uses two Lookup Relationship fields pointing back to the parent object. This approach works for any custom object where a hierarchical relationship is needed.
Note: This is not a built-in Salesforce CRM feature for standard custom objects. The workaround requires creating an intermediate custom object.
The following steps create a parent-child hierarchy for a custom object by using an intermediary custom object with two lookup fields — one pointing to the Parent record and one to the Child (Sub) record.
Navigate to Custom Objects in Setup:
Create the first Custom Relationship within the new object to establish the Parent:
Create the second Custom Relationship within the new object to select the Sub (child):
Navigate to Page Layouts in Setup:
Users can now create a new Sub record that references another record in a parent-child hierarchical setup.
For additional information related to object relationships please review the article below:
https://help.salesforce.com/articleView?id=overview_of_custom_object_relationships.htm&type=5
See Also: Set Up Account Hierarchy in Lightning Experience
000385441

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.