We have a department like many with a director and multiple layers of supervisors. Some employees may be only one layer away from the director while others may be multiple layers away.
For various reasons we're trying to pull a list of all of our employees from a much larger enterprise list (without a department field) by starting with the director, getting his direct reports, then getting their direct reports, on down the line until we have everyone including our non-supervisory employees. I've been trying to do this in a cursor, however, the problem is that some "threads" have one level while other more compartmentalized groups have multiple levels. I can't seem to figure out how to code for this indeterminate number of iterations depending on which group it is....
Has anyone ever done something similar or have any suggestions or---even better---code snippets? I would think it would be a similar process to what you would need to do to generate an Org Chart on-the-fly.... Thanks!
For various reasons we're trying to pull a list of all of our employees from a much larger enterprise list (without a department field) by starting with the director, getting his direct reports, then getting their direct reports, on down the line until we have everyone including our non-supervisory employees. I've been trying to do this in a cursor, however, the problem is that some "threads" have one level while other more compartmentalized groups have multiple levels. I can't seem to figure out how to code for this indeterminate number of iterations depending on which group it is....
Has anyone ever done something similar or have any suggestions or---even better---code snippets? I would think it would be a similar process to what you would need to do to generate an Org Chart on-the-fly.... Thanks!