Thursday, October 13, 2022

lightning-tree-grid - Account Hierarchy Using lightning-tree-grid in LWC

 In this blog, I am going share a approach through which you can display account hierarchy using lightning tree grid. You can place this lightning component on account record page and it will detect the current account record Id and will display the complete hierarchy.

I am utilising formula field called "Ultimate Account id" to avoid multiple SOQL in apex to get list of all account in the hierarchy. This component can display all account which are up to 10 level deep in hierarchy.

Please refer below URL to get more idea about Ultimate Account Id formula field.

How to get list of all accounts present in account hierarchy in Salesforce

In this LWC component, I am just passing the account Id to apex method and apex method returns all the account list which are present in hierarchy. In order to display account in tree grid, I am creating data in js which will be accepted by tree grid. So in this approach, manipulation on apex side is very simple.

Note: Create Ultimate Account Id formula field on account first in order to implement below code.

Complete Code:

Hope this will help!!!


  1. Hello, This blog is very informative for every one, It's a Great think to help everyone thanks. Visit our website and find Great products in very cheap price

  2. Nice blog post.
    Sobha Galera luxury project provides 4 BHK row house launching in Hoskote, Bangalore

  3. Thank you for this informative post this blog contains some interesting topics keep doing this work also have a look on this School with best rating

  4. Hi there,
    loved all that you shared ,so clear and easy to follow.
    is there any issue your laptop ....We are provide solution
    Laptop Service Center in Chennai

  5. Thanks for sharing

  6. Thanks for the sharing information, we provide best solution for sexual problems.

  7. Keep doing this work also have a look on this School with best rating thank you for this wonderful post this blog contains interesting topics

  8. Professionals use Tableau as a tool to make interactive data dashboards and other engaging data visualisations. These dashboards can be distributed to organisational decision-makers and executives, enabling them to immediately spot patterns and trends in massive amounts of data. Additionally, people can utilise interactive data visualisation dashboards to cut and dice data in various ways to study how inputs may change broad patterns and trends.
    Because Tableau is a user-friendly product, even people with no prior technical knowledge may learn how to use it. This product is really well-liked because it is simple to understand. It appeals to both small enterprises and big corporations like Whole Foods, Verizon, and Cigna because of its adaptability, simplicity, and capacity to visualise massive volumes of data. Tableau is also used by public institutions like state and local governments to organise and present their data.
    Tableau Features
    The fact that Tableau has both premium and free versions will be appreciated by anyone who is interested in learning how to use it. Even on a tight budget, people may learn how to organise, analyse, and visualise their data using this program. One of its products, for instance, stores data in the cloud in a way that allows everyone to examine the data and visualisations; of course, this feature is excellent for people who aren't dealing with sensitive data!

  9. A while ago i met a online cryptocurrency investing company who promised to double my investment within a month and i could also get bonus if i invested more so i agreed and i invested $10000 to get $20000 in return so i was so happy to work with them at first not until the day i was meant be credited my funds they suddenly went MIA and i was left devastated,sad and angry that i was being scammed not until a friend of mine came around and introduced Premiumhackservices AT gmail DOT com, they told me not to worry and i gave them the necessary information and evidence of payment and they did what i thought was impossible which was getting my funds back and i was happy again all thanks to them, you can also contact them via Whatsapp +14106350697 and they will be at your service.

  10. Espiritu Santo Island is one of the most mentioned undertakings mentioned by explorers who visit La Paz, and justifiably, since swimming with ocean lions is quite possibly of the most unimaginable experience that you can live in La Paz.

  11. The goods limitless save in Cedar Park, TX, gives an extensive range of rubber gloves for one-of-a-kind existence. They've rubber gloves for folks that are active, folks that are sedentary, and people who are somewhere in between.
    Get Rubber gloves in Cedar Park TX

  12. Enormous trees frequently fall because of weighty downpour and make what is going on complex with the harms made on the contiguous properties.
    Tree Service

  13. Learn French Enligne is a leading online French institute, has established partnerships with international institutions to provide top-notch French language education. With experienced teachers from both India and France, LFE offers high-quality courses for learners of all levels, along creative workshops, masterclasses, intensive courses, exam preparation courses, and a French teacher training program.

  14. I think everyone should read your blog who want to learn more about nmims project report

  15. I think everyone should read your blog who want to learn more about smu project

  16. <I lost my job few months back and there was no way to get income for my family, things was so tough and I couldn’t get anything for my children, not until a met a recommendation on a page writing how Mr Bernie Wilfred helped a lady in getting a huge amount of profit every 6 working days on trading with his management on the cryptocurrency Market, to be honest I never believe it but I took the risk to take a loan of $2000. and I contacted him unbelievable and I was so happy I earn $22,500 in 6 working days, the most joy is that I can now take care of my family I don’t know how to appreciate your good work Mr. Bernie Doran God will continue to bless you for being a life saver I have no way to appreciate you than to tell people about your good services.
For a perfect investment and good strategies contact Mr Bernie Doran via Telegram : @Bernie_fx or Email :

  17. we face any issue regarding its servicing or any technical problem, we try to solve it as soon as possible and that too from well trained professionals. Dell Laptop Service Center will help you come out and give you benefits of high quality service. Their expert technicians ensure that you get all your laptops issues resolved timely and in accost effective manner.
    Dell Laptop Service Center in Noida
    Dell Laptop Service Center in Noida Sector-18
    Dell Laptop Service Center in Noida Sector-62
    Dell Laptop Service Center in Noida Sector-15,16
    Dell Laptop Service Center in Noida Sector-50,51,52

  18. "Best Montessori Preschool in Pinner aims to provide a nurturing, safe and fun environment helping children to develop to their fullest potential. Nursery in pinner

  19. Leading CRM Strategy agency
    dedicated to helping companies scale
    their CRM investment

    A CRM system is more than just software; it's a growth engine.
    We specialize in turning your CRM investment into a powerhouse for business expansion.
    Stop missing out on revenue-generating opportunities and start harnessing the full potential of your CRM.
    Boost your sales pipeline and revenue with our comprehensive,
    proven services in revenue marketing, strategic marketing, and marketing technology

    CRM Strategy