Custom Security Criteria is not working on Org Tree
Summary: I am trying to use the below SQL query in Custom Security Criteria. When I run this query it returns the 8 employees the HR Rep is supposed to see.
exists
(
select 1
from per_asg_responsibilities par
,per_org_tree_node potnc
,fnd_tree_vl ftv
,fnd_tree_version_tl ftvt
,hr_all_organization_units org
,per_all_assignments_m paam
,per_periods_of_service ppos
where 1=1
and trunc(sysdate) between paam.effective_start_date and paam.effective_end_date
and trunc(sysdate) between org.effective_start_date and org.effective_end_date
and (par.end_date is null or par.end_date > sysdate)
0