Does anyone have a suggestion to replicate a “My T...
# suiteql
c
Does anyone have a suggestion to replicate a “My Team” type of filter in SuiteQL? So, for example if I manage 2 people, and they manager 5 people, “my team” includes the two I manage, plus the 5 they manage? With normal SQL I would use somehting like Connect By Prior but I don’t believe SuiteQL supports that?
m
I've never used it but have you tried the named group built in function? https://system.netsuite.com/app/help/helpcenter.nl?fid=article_161950565221.html&whence=
c
I’ve used that for filtering to the current user (‘me’), but couldn’t figure out how to do it for my team
z
I wonder if you could store a multi-select list of the team in the entity record and then join on that. It would be a workaround, but seems fairly simple.
c
I figured this out using a subquery BTW. Turns out connect by prior does work:
SELECT id my_id, supervisor
FROM employee
START WITH id = BUILTIN.NAMED_GROUP('employee', 'me')
CONNECT BY PRIOR id = supervisor