Hello, Does anyone know how to get supervisor hier...
# suiteql
p
Hello, Does anyone know how to get supervisor hierarchy by Employee.id?
p
Tried. It errors out that supervisor field does not support HIERARCHY function.
w
Hmm, yeah, maybe employees aren't a hierarchical record in the same way as classification
And now I needed the same thing and couldn't get anything to work. Tried a bunch with CONNECT BY to get a meaningful output similar to the full hierarchy shown for classifications, but no success. I ended up scripting it with this instead.
p
This SuiteQL works
Copy code
SELECT
  id AS EMPLOYEE_ID,
  entityId AS EMPLOYEE_NAME,
  supervisor AS MANAGER_ID,
  BUILTIN.DF(supervisor) as MANAGER_NAME,
  level AS LEVEL
FROM
  Employee START WITH id = 21 CONNECT BY PRIOR supervisor = id
... where 21 is employeeId we want the hierarchy of.
w
I was looking for the "Supervisor 1 : Supervisor2 : Employee" output, which above doesn't give me. Or being able to use the pseudo column CONNECT_BY_ROOT.