You need to sign in to do that
Don't have an account?

I would like to know the best way to query a hierarchical database to find parent, grandparent, great-grandparent...
I would like to know the best way to query a hierarchical database to find parent, grandparent, great-grandparent... I think I need to use a combination of Apex and SOQL. Once I'm at the top I need to find out who the Manager is for all the children. I am trying everything I can think of to not have query governor issues. Any help would be greatly appreciated.
Select Parent.Parent.Parent.Parent.Parent.ParentId, Parent.Parent.Parent.Parent.ParentId, Parent.Parent.Parent.ParentId, Parent.Parent.ParentId, Parent.ParentId, ParentId From Account