Employee Manager Role for only Active Employees

Hello Experts,

I have been trying to figure out a way to assign the Employee Manager role in OneIM to only those who have active persons listed as their direct report.  Currently if a person has an inactive employee listed it still assigns the employee manager role.  We have certain DLs that are dynamic an looks at this role for for provisioning.  I am am needing to make sure "Employee Manager " role is not assigned to those who have past inactive employees listed.  This would be very important in case we have a manager that gets demoted and has some employees listed as direct report but they are all inactive, Employee manager role should be stripped off.

I do see this code in the dynamic role for Employee manager but do not know how to tell to assign only if the direct reports are active.  We are currently using 8.0.1 version of OneIM

UID_Person in (select p.UID_PersonHead
from HelperHeadPerson p
where p.XOrigin > 0
union all
select o.UID_PersonHead
from HelperHeadOrg o
where o.XOrigin > 0
)
and isnull(IsInActive, 0) = 0

All your help is greatly appreciated.

Thank you,

JP

Parents
  • The following condition adds the check for the IsInactive flag for the direct reports only. So the manager would need at least one active direct report.

    UID_Person in (select p.UID_PersonHead 
    from HelperHeadPerson p join Person p2 on p.UID_Person = p2.UID_Person and p2.IsInActive = 0
    where p.XOrigin > 0
    union all 
    select o.UID_PersonHead
    from HelperHeadOrg o 
    where o.XOrigin > 0
    )
    

Reply
  • The following condition adds the check for the IsInactive flag for the direct reports only. So the manager would need at least one active direct report.

    UID_Person in (select p.UID_PersonHead 
    from HelperHeadPerson p join Person p2 on p.UID_Person = p2.UID_Person and p2.IsInActive = 0
    where p.XOrigin > 0
    union all 
    select o.UID_PersonHead
    from HelperHeadOrg o 
    where o.XOrigin > 0
    )
    

Children
  • Thank you Markus,  That seems to have done the trick.  I really appreciate your assistance.

  • Good afternoon. Tell me, please.
    The following role exists - Base roles\Employee Managers.
    It is necessary that this role is displayed only for working employees.
    The following problem arose. When an employee quits, his manager is displayed in the manager field. Unfortunately, this breaks the logic of AD and other systems. Since the manager displays dismissed employees. Thus, dead souls are formed.
    Please tell me how can I fix this.....

    i found this script

    UID_Person in (select p.UID_PersonHead
    from HelperHeadPerson p
    where p.XOrigin > 0
    union all
    select o.UID_PersonHead
    from HelperHeadOrg o left outer join BaseTree b on o.UID_Org=b.UID_Org and b.UID_OrgRoot='QER-V-AERole'
    where o.XOrigin > 0 and b.UID_Org is null -- a manager of AERole should not be employee manager
    )
    and isnull(IsInActive, 0) = 0