My company has a three-tiered management level (Section, Branch, Division) and I have a query that looks up all of the employee records for a section by selecting that section from a drop-down menu. I would like the Branch managers and the Division manager to be able to see only their direct subordinates when they select their branch or division from the drop-down...
So far it works at the lowest level only, where a Section manager will see all of their employees except themselves, because I set a filter to only show records where a flag "IsSupervisor" is FALSE. I want the Branch managers to only see the Section managers underneath them (and change the filter of the "IsSupervisor" field), and I want the Division manager to only see the Branch managers.
I'm open to changing the database, but I'd prefer to accomplish this with some kind of query that recognizes the orgID as a branch-level or division-level and then only returns a specific set of records based on the employeeID of those section/branch managers. I don't mind hard-coding the records that it should return because there are relatively few managers.
Any thoughts?