FND_PROFILE.VALUE('USER_ID') is not returning the correct value when used in custom security query
I need to create a security profile which will restrict the employees viewable by the user based on the his/her organization and a segment in pay_people_group. I tried using FND_PROFILE.value('USER_ID') but it doesn't seem to give the correct value during runtime. When the user_id is hard-coded, the fitlering works fine. I have attached the custom security query below. Any ideas why?
person.person_id in .person_id in (Select distinct a.person_id distinct a.person_id
from per_all_assignments_f a,
pay_people_groups b, , hr_all_organization_units c0