The most probable reason you are reading this blog is because you want to implement the hierarchy setting just like the Account entity.

By enabling the hierarchy setting of an entity, you will have an option to display your data in a graphical tree structure with the help of card form.

In this tutorial, we will use Contact entity because by default, it has no hierarchy setting.

Below are the steps to

  1. Create 1:N relationship, this will create a lookup named Parent in Contact.
  1. Create a solution and add the Contact entity in the solution.
  2. From the solution, select Contact entity and click 1:N relationship.
  3. Click New 1-to Many Relationship icon.

pic1 components

 

pic2 contacts to contacts

 

  1. Click Save and Close.
  1. Configure Hierarchy Setting.
  1. In the solution, under Contact, click Hierarchy Setting.

pic3 hiearchy

 

  1. Click New
  2. Give it a name

pic4 parent contact

 

  1. Select a form that will be displayed, in this case, we will use Contact Card.
  2. Click Mark a relationship as enabled for hierarchies.
    • A dialog will be displayed.
  3. Click Mark hierarchical
  4. Select 1:N relationship you recently created (lfk_contact_contact)
  5. Click Done
    • The dialog will be closed.

pic5

 

  1. Notice that the Hierarchical Relationship field has now a value

pic6 save and close

 

  1. Click Save and Close.
  1. Add the Parent lookup in your form
  1. Edit the Contact form
  2. Add the field Parent

pic7 details

  1. Click Save and Close
  1. From Solution, click Publish All Customization.

 

Now, let’s test what we have configured.

  1. Create 3 contact records
  1. Name: Gloria Minana
    • Parent field: blank
  2. Name: Anne Minana
    • Parent field: Gloria Minana
  3. Name: Andrew Minana
    • Parent field: Gloria Minana
  1. Navigate to Contact list.
  2. Navigate to Andrew Minana record. Did you notice the Hierarchy icon?

pic8

 

  1. The hierarchical tree is displayed.

pic9 andrew minana