Tuesday, October 13, 2015

Oracle EBS - finding function id ( function_id ) for the current form for the logged in user in pl/sql

We might get a requirement where you want to show same form function twice under a responsibility with different names and showing different data.

Let`s say the data being displayed comes from a View.

You can differentiate between the two by their function_id

So, you need to find out function_id  of the function you are accessing.

The below query returns 1 if logged in user is accessing a particular function - say 'FUNC_NAME'

select count(*) into v_count from icx_sessions icx,FND_FORM_FUNCTIONS_vl func where user_id =(select user_id from FND_LOGINS where login_id=FND_GLOBAL.LOGIN_ID) and login_id=FND_GLOBAL.LOGIN_ID and func.FUNCTION_NAME = ‘FUNC_NAME' and icx.function_id=func.FUNCTION_ID;

If you use below query then also it will work but it will be slow and you might need to create an index on login_id which is not advisable

select count(*) into v_count from icx_sessions icx,FND_FORM_FUNCTIONS_vl func where login_id=FND_GLOBAL.LOGIN_ID and func.FUNCTION_NAME = ‘FUNC_NAME' and icx.function_id=func.FUNCTION_ID;

1 comment: