Monday, October 30, 2017

Lightning Tree : Generic Lightning Component to Display Hierarchy for any sObject

In API version 41.0, Salesforce has introduce new component called lightning:tree. This can be used to display hierarchy in tree structure. Before this, we have to used jquery or other javascript libraries to implement this.

After introduction of lightning:tree, it is very easy to use this and implement this in short time.

I have created a generic lightning component to display records hierarchy in tree structure. You just have specify below attributes to component to display tree structure:

  • ltngcurrentRecId : Salesforce 15 or 18 digit Id of any record for which you want to see hierarchy.
  • ltngSobjectname : sObject API name (like Account, Case, Position__c etc.)
  • ltngParentFieldAPIName : Field API name which creates self relationship between records.
  • ltngLabelFieldAPIName : Field API name which will be used to display records in tree structure(like Name, CaseNumber, Title__c etc.).
  • ltngHierarchyHeader : Header label which will be displayed above tree structure.


Below is complete complete code for your reference:


You can use this code as reference and can implement different logic.

Hope this will help!!!

Looking forward for everyone's comments and suggestions.

134 comments:

  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Front end developer learn from Javascript Training in Chennai . or learn thru Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry. JavaScript Training in Chennai

    ReplyDelete
    Replies
    1. Great Article
      Cloud Computing Projects


      Networking Projects

      Final Year Projects for CSE


      JavaScript Training in Chennai

      JavaScript Training in Chennai

      The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

      Delete
  2. Is there any way to return additional fields for the tree as well? Perhaps even just a name + text field?

    ReplyDelete
  3. Hi,

    Create formula field and concatenate all the fields values as per required format and then refer that formula field in "ltngLabelFieldAPIName" attribute.
    ltngLabelFieldAPIName="UniqueValue__c"


    Hope this helps!!

    Thanks

    ReplyDelete
  4. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
    microsoft azure training in bangalore
    rpa training in velachery| rpa training in tambaram |rpa training in sholinganallur | rpa training in annanagar| rpa training in kalyannagar

    ReplyDelete
  5. Want to have fun and get paid for it? we have bonus slot machines .Come to us and have fun getting money for it.

    ReplyDelete
  6. Thanks Admin for sharing such a useful post, I hope it’s useful to many individuals for developing their skill to get good career.
    python Course in Pune
    python Course institute in Chennai
    python Training institute in Bangalore

    ReplyDelete
  7. Thanks For Sharing The Information The Information shared Is Very Valuable Please Keep Updating Us Time Just Went On reading The Article Aws Online Course Python Online Course Data Online Course Hadoop Online Course

    ReplyDelete
  8. Hi, is it possible to create a similar dynamic lightning:treeGrid or modify the above code to use lightning:tree within aura:iteration to meet the requirement? Thanks!

    ReplyDelete
  9. Attend The Python training in bangalore From ExcelR. Practical Python training in bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Python training in bangalore.
    python training in bangalore

    ReplyDelete
  10. Attend The Best Python Training in Bangalore From ExcelR. Practical Python Training in Bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Best Python Training in Bangalore.

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. ExcelR offers data science training in hyderabad , the most comprehensive Data Science course in the market, covering the complete Data Science lifecycle concepts from Data Collection, Data Extraction, Data Cleansing, Data Exploration, Data Transformation, Feature Engineering, Data Integration, Data Mining, building Prediction models.

    ReplyDelete
  13. Awesome Blog, It helped me to get into the next level and had lot of information in it, I really appreciate. Thanks for sharing this information. Keep blogging!! machine learning course bangalore

    ReplyDelete
  14. Attend The Data Analytics Courses in Bangalore From ExcelR. Practical Data Analytics Courses in Bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Analytics Courses in Bangalore.
    ExcelR Data Analytics Courses in Bangalore

    ReplyDelete
  15. My spouse and I love your blog and find almost all of your post’s to be just what I’m looking for. Artificial Intelligence Course

    ReplyDelete
  16. Very interesting blog Thank you for sharing such a nice and interesting blog and really very helpful article.sap mm Training in Bangalore

    ReplyDelete
  17. Its really helpful for the users of this site. I am also searching about these type of sites now a days. So your site really helps me for searching the new and great stuff.sap basis Training in Bangalore

    ReplyDelete
  18. Very useful and information content has been shared out here, Thanks for sharing it.sap hr Training in Bangalore

    ReplyDelete
  19. These provided information was really so nice,thanks for giving that post and the more skills to develop after refer that post.sap bw Training in Bangalore

    ReplyDelete
  20. Your articles really impressed for me,because of all information so nice.sap ehs Training in Bangalore

    ReplyDelete
  21. Really it was an awesome article,very interesting to read.You have provided an nice article,Thanks for sharing.sap abap Training in Bangalore

    ReplyDelete
  22. I know that it takes a lot of effort and hard work to write such an informative content like this.sap fico Training in Bangalore

    ReplyDelete
  23. Nice information, valuable and excellent work, as share good stuff with good ideas and concepts, lots of great information and inspiration, both of which I need, thanks to offer such a helpful information here. data science course

    ReplyDelete
  24. I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own Blog Engine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it.
    ExcelR Data Analytics Course

    ReplyDelete
  25. This post is very simple to read and appreciate without leaving any details out. Great work!
    Please check ExcelR Data Science Courses

    ReplyDelete
  26. Nice post. Thanks for sharing! I want people to know just how good this information is in your blog. It’s interesting content and Great work.
    machine learning training in hyderabad
    data science course in hyderabad
    business analytics courses in hyderabad

    ReplyDelete
  27. Actually I read it yesterday but I had some thoughts about it and today I wanted to read it again because it is very well written.
    data science courses

    ReplyDelete
  28. Awesome article! I want people to know just how good this information is in your article. It’s interesting, compelling content. Your views are much like my own concerning this subject. Residential Tree Removal

    ReplyDelete
  29. Thank you so much for sharing this excellent information. I am glad to discover your post.
    Hadoop Training in Hyderabad

    ReplyDelete
  30. This Was An Amazing ! I Haven't Seen This Type of Blog Ever ! Thankyou For Sharing, data science traning

    ReplyDelete
  31. Attend The Data Analytics Courses From ExcelR. Practical Data Analytics Courses Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Analytics Courses.
    Data Analytics Courses
    Data Science Interview Questions

    ReplyDelete
  32. As always your articles do inspire me. Every single detail you have posted was great. ExcelR Machine Learning Course

    ReplyDelete
  33. I feel very grateful that I read this. It is very helpful and very informative and I really learned a lot from it.

    data science course

    ReplyDelete
  34. This Was An Amazing ! I Haven't Seen This Type of Blog Ever ! Thankyou For Sharing, data science online training

    ReplyDelete
  35. I believe that your blog will surely help the readers who are really in need of this vital piece of information. Waiting for your updates

    AWS training in chennai | AWS training in annanagar | AWS training in omr | AWS training in porur | AWS training in tambaram | AWS training in velachery

    ReplyDelete
  36. Nice Blog ! It was really a nice article and i was really impressed by reading this. Thanks for sharing such detailed information.
    Data Science Training in Hyderabad

    ReplyDelete

  37. The information you have posted is very useful. The sites you have referred was good. Thanks for sharing. ExcelR Data Science Course In Pune

    ReplyDelete
  38. wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries.
    Data Science Course

    ReplyDelete
  39. Just the way I have expected. Your website really is interesting. ExcelR Data Scientist Course In Pune

    ReplyDelete
  40. This was really one of my favorite website. ExcelR Machine Learning Course In Pune Please keep on posting.

    ReplyDelete
  41. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Correlation vs Covariance
    Simple linear regression

    ReplyDelete

  42. Great post i must say and thanks for the information.
    Data Science Training in Hyderabad

    ReplyDelete
  43. This Was An Amazing ! I Haven't Seen This Type of Blog Ever ! Thankyou For Sharing, data scientist courses

    ReplyDelete
  44. Thanks for the blog loaded with so many information. Stopping by your blog helped me to get what I was looking for. hashtag for instagram likes and followers app

    ReplyDelete
  45. I am looking for and I love to post a comment that "The content of your post is awesome" Great work!

    Simple Linear Regression

    Correlation vs Covariance

    ReplyDelete
  46. I finally found great post here.I will get back here. I just added your blog to my bookmark sites. thanks.Quality posts is the crucial to invite the visitors to visit the web page, that's what this web page is providing.
    artificial intelligence course in bangalore

    ReplyDelete
  47. Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.
    https://360digitmg.com/internet-of-things-iot-in-hyderabad

    ReplyDelete
  48. Amazing post found to be very impressive while going through this post. Thanks for sharing and keep posting such an informative content.

    360DigiTMG Cloud Computing Course

    ReplyDelete
  49. Amazing Article ! I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Correlation vs Covariance
    Simple Linear Regression
    data science interview questions
    KNN Algorithm

    ReplyDelete
  50. Data science involves the study of data, which includes different stages, such as extraction, analysis, visualization, management and storage of data for creating insights. data science course syllabus

    ReplyDelete
  51. I am looking for and I love to post a comment that "The content of your post is awesome" Great work!

    Simple Linear Regression

    Correlation vs Covariance

    bag of words

    time series analysis

    ReplyDelete
  52. The above post that you shared is informative. keep doing this kind of work and the method you used to presenting the examples are easy to understand. I would like to thank for this wonderful blog. the article inspires me to do more research about this topic.

    Aws Training in Chennai

    Aws Training in Velachery

    Aws Training in Tambaram

    Aws Training in Porur

    Aws Training in Omr

    Aws Training in Annanagar

    ReplyDelete
  53. I am really happy to say it’s an interesting post to read . I learn new information from your article , you are doing a great job . Keep it up

    Devops Training in USA

    Hadoop Training in Hyderabad

    Python Training in Hyderabad

    ReplyDelete
  54. Great survey. I'm sure you're getting a great response. ExcelR Business Analytics Courses

    ReplyDelete
  55. This is a great motivational article. In fact, I am happy with your good work. They publish very supportive data, really. Continue. Continue blogging. Hope you explore your next post
    data science training

    ReplyDelete
  56. keep up the good work. this is an Ossam post. This is to helpful, I have read here all post.
    I am impressed. thank you. This is our site please visit to know more information
    Data Science Course in Hyderabad

    ReplyDelete
  57. Wood ground surface can be bought and introduced either production line completed or incomplete. Completed items are by and large the simpler approach since it will be finished and prepared to stroll on following establishment.Vietnam manufacturing

    ReplyDelete
  58. Terrific post thoroughly enjoyed reading the blog and more over found to be the tremendous one. In fact, educating the participants with it's amazing content. Hope you share the similar content consecutively.
    Data Analytics Course in Raipur

    ReplyDelete
  59. i am glad to discover this page : i have to thank you for the time i spent on this especially great reading !! i really liked each part and also bookmarked you for new information on your site.
    best data science courses in bangalore

    ReplyDelete
  60. i am glad to discover this page : i have to thank you for the time i spent on this especially great reading !! i really liked each part and also bookmarked you for new information on your site.
    cyber security training in bangalore

    ReplyDelete
  61. I want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors.
    data science course fees in bangalore

    ReplyDelete
  62. Great post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time. I appreciate your post and look forward to more.
    Data Science Course in Bangalore

    ReplyDelete
  63. Fantastic blog! Thanks for sharing a very interesting post, I appreciate to blogger for an amazing post.

    Python Institutes in Pune
    Python Classes in Pune

    ReplyDelete
  64. When your website or blog goes live for the first time, it is exciting. That is until you realize no one but you and your.
    data scientist training in hyderabad

    ReplyDelete
  65. Your content is very unique and understandable useful for the readers keep update more article like this.
    best data science course online

    ReplyDelete
  66. This knowledge.Excellently written article, if only all bloggers offered the same level of content as you, the internet would be a much better place. Please keep it up.
    artificial intelligence course in aurangabad

    ReplyDelete
  67. This comment has been removed by the author.

    ReplyDelete
  68. There are also times when trees can pose a threat to your property, when the roots have all popped out and can trip your kids. Roots can also puncture the sewer and plumbing lines. Tree Cutting Lincoln

    ReplyDelete
  69. When starting the bonsai interest, there are a few things you should think about first. The expense of trees and supplies should be remembered. For thirty dollars or thereabouts, a decent starting plant can be bought.Tree Removal Elk Grove

    ReplyDelete
  70. This kind of actually also a good placed that we in reality actually appreciated looking into. It isn't automatically typical that we are the substitute for establish a certain factor. Tree Trimming Rancho Cucamonga

    ReplyDelete
  71. Thanks for posting the best information and the blog is very important.digital marketing institute in hyderabad

    ReplyDelete
  72. In the event that your trunk is rotting, you will see bugs and mushrooms developing all through the lower part of the tree. Emergency Tree Service Sacramento

    ReplyDelete
  73. The solitary conceivable benefit of working an enormous scope one is that it can oblige various customers all at once. marketing agency

    ReplyDelete
  74. This really is at the same time a terrific subject matter as i somewhat certainly wanted taking a look at. This may not quite frequently that we include possibility to lift weights a major issue. Tree Removal Encinitas

    ReplyDelete
  75. In the ninth century the name 'Pine' had yet to be coined, so today if you translate that saying, you get, 'The city of Venice rests on the hearts of Pine. How Fast Do Pine Trees Grow

    ReplyDelete
  76. When starting the bonsai leisure activity, there are a few things you should think about first. Stump Grinding Pearland

    ReplyDelete
  77. A salesforce stuff, good and quality content shared, keep sharing.

    Data Science Training in Pune

    ReplyDelete
  78. Before you start a tree removal service, there are a lot of things you should take into consideration. Emergency Tree Service Irvine

    ReplyDelete
  79. You may also check if the persons that the company will send at your place have the necessary training that proves that they are capable of doing the job. Tree Trimming Garden Grove

    ReplyDelete
  80. A few trees might debilitate the foundation of your home in view of developing roots underneath the land over the long run. Tree Trimming Rocklin

    ReplyDelete
  81. I recently came across your article and have been reading along. I want to express my admiration of your writing skill and ability to make readers read from the beginning to the end.
    Python Classes in Pune

    ReplyDelete
  82. A professional company will be able to handle big jobs by using the best tools and methods available. Safest Tree Removal Methods Tree Service Experts Elk Grove

    ReplyDelete
  83. If getting your tree removed is really needed, getting a professional tree service is important. Tree Cutting services Riverside, CA

    ReplyDelete
  84. But before deciding on which service contractor to get, one must identify the reason of the tree removal service. Some of the most common tree problems are dead trees and branches, fungus growths and leaning trees. modern tree service tools

    ReplyDelete
  85. I appreciate you sharing this blog article. Really thank you! Really Great.Stump Grinding Long Beach

    ReplyDelete
  86. Appreciate you sharing great blog. Thanks Again.
    modern tree service tools

    ReplyDelete
  87. Really enjoyed this blog post. Really thank you! Really Great.Tree Cutting professionals Louisville

    ReplyDelete
  88. Truly overall quite fascinating post. I was searching for this sort of data and delighted in perusing this one. Continue posting. Much obliged for sharing.artificial intelligence course in chennai

    ReplyDelete
  89. Im thankful for the post. Really looking forward to read more. Want more.Safest Tree Removal Methods Tree Service Experts Nashville

    ReplyDelete
  90. I was actually browsing the internet for certain information, accidentally came across your blog found it to be very impressive. I am elated to go with the information you have provided on this blog, eventually, it helps the readers whoever goes through this blog. Hoping you continue the spirit to inspire the readers and amaze them with your fabulous content.

    Data Science Course in Faridabad

    ReplyDelete
  91. This is also a very good post which I really enjoyed reading. It is not every day that I have the possibility to see something like this..
    artificial intelligence courses aurangabad

    ReplyDelete
  92. Great tips and very easy to understand. This will definitely be very useful for me when I get a chance to start my blog.
    data scientist course

    ReplyDelete
  93. Your second cut should create a wedge into the tree. So make the second cut at an angle from the initial cut. It should look like a lemon wedge. Tree removal Sanford NC

    ReplyDelete
  94. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. Arbor Care Solutions

    ReplyDelete
  95. Extremely overall quite fascinating post. I was searching for this sort of data and delighted in perusing this one. Continue posting. A debt of gratitude is in order for sharing. cloud computing course in jaipur

    ReplyDelete
  96. Impressive blog to be honest definitely this post will inspire many more upcoming aspirants. Eventually, this makes the participants to experience and innovate themselves through knowledge wise by visiting this kind of a blog. Once again excellent job keep inspiring with your cool stuff.

    Data Science Training in Bhilai

    ReplyDelete
  97. Extremely overall quite fascinating post. I was searching for this sort of data and delighted in perusing this one. Continue posting. A debt of gratitude is in order for sharing. data scientist course in lucknow

    ReplyDelete



  98. This blog contains more information,keep sharing your valuable thoughts.
    Appium Certification in Chennai
    Appium Training

    ReplyDelete
  99. I really liked your blog post. Much thanks again. Will read on...tree trimming

    ReplyDelete
  100. Cool you write, the information is very good and interesting, I'll give you a link to my site. business analytics course in surat

    ReplyDelete
  101. Web Development India offer website development services, php development services, laravel development services etc services offer by website development company in india

    ReplyDelete
  102. A tree surgeon (or arborist) helps to treat sick or indeed damaged trees. They also remove dead trees that could be problematic. The treatment of a sick tree could involve anything from removing parts, to removing fungus and bacteria with insecticides. They also help to remove branches which may pose a falling hazard. http://treethyme.co.uk

    ReplyDelete
  103. I want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors
    data science course in thiruvananthapuramI want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors
    data science course in thiruvananthapuram

    ReplyDelete
  104. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. Great work
    data science training

    ReplyDelete
  105. wow, great, I was wondering how to cure acne naturally. and found your site by google, learned a lot, now i’m a bit clear. I’ve bookmark your site and also add rss. keep us updated. PMP Course in Malaysia

    ReplyDelete
  106. I’m happy I located this blog! From time to time, students want to cognitive the keys of productive literary essays composing. Your first-class knowledge about this good post can become a proper basis for such people. nice one. PMP Course

    ReplyDelete
  107. You can likewise look on the web and find sites where you can profit specialist of tree administration. tree surgeon worcester

    ReplyDelete
  108. Generally I don’t read post on blogs, but I wish to say that this write-up very forced me to try and do so! Your writing style has been surprised me. Thanks, very nice post. Best of luck for the next! Please visit my web site proarbcanterbury.kiwi. Best Arborist Canterbury service provider.

    ReplyDelete
  109. An organization like JL Tree Administration Inc has more than 18 top tree climbers with numerous long stretches of involvement with enormous expulsions and crane evacuations.
    tree services Columbia MO

    ReplyDelete
  110. The cost of tree cutting will be around $200 and $400. With more modest trees for example those growing 30 feet and beneath, the expulsion expenses are from $120. tree removal

    ReplyDelete
  111. Adding just two creeps of soil to the establishing region can be sufficient to kill a full grown tree.
    tree trimming

    ReplyDelete
  112. Python is a programming language that enables quicker work and more efficient system integration. Because of its simplicity, ease of use, and accessibility to libraries like NumPy, Pandas, and Matplotlib, it is one of the best languages used by data scientists for a variety of data science applications. You will gain a multidisciplinary skill set and be prepared to work with massive volumes of data to find insights and solutions to business challenges after completing this data science certification course. Having this certification will provide you a technical understanding of computer science and statistics in addition to a postgraduate degree. It covers the spring framework, hibernate, and advanced java.best data science institute in nashik with placement

    ReplyDelete