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
Ramadhar MishraRamadhar Mishra 

cumulative count of all nodes in Account Hierarchy

Hi All,


I have Account hierarchy in my project and the max level of depth is 7 level.

My client requirement is to while showing the hierarchy the top most node should show the cumulative count of child in hierarchy.

I am looking an approach  to show cumulative count of all nodes ie. like for node Test 1 [cumulative count :7].

For example I have


Test1   [cumulative count : 7]



Test2 --------------------------

  |                |                     |

  |              Test21          Test 22

Test3   ---------------------------

  |               |                     |

  |             Test31          Test32


 For the above hierarchy For the node (Test1) cumulative count should be 7.