Forum Stats

  • 3,751,231 Users
  • 2,250,334 Discussions
  • 7,867,350 Comments

Discussions

How to redirect a certain group login in to another page apex oracle

1010628
1010628 Member Posts: 2
edited May 23, 2013 3:01PM in APEX Discussions
so I'm kind of new to apex and If I had a log in page and a certain user logs in that belongs to a certain group... say customers? Well if they log in , it would redirect them to a customer application.. and this is what I'm currently trying to achieve but it doesn't work

This is my code, can you tell me why it doesn't work and a solution to it?




DECLARE
VAL BOOLEAN;
BEGIN
IF
VAL := APEX_UTIL.CURRENT_USER_IN_GROUP(p_group_name=> 'Customer')
RETURN TRUE
THEN

htp.init;
owa_util.redirect_url('f?p=&Custlogin.:1:&APP_SESSION.');
apex_application.stop_apex_engine;

END IF

END;
Tagged:

Answers

  • Kleber M-Oracle
    Kleber M-Oracle Member Posts: 213
    edited May 23, 2013 3:01PM
    Where are you putting this code? In a Before Header section?

    I can see there are some possible compilation issues with the code. I think you'd better use:

    {
    BEGIN
    IF APEX_UTIL.CURRENT_USER_IN_GROUP(p_group_name=> 'Customer')
    THEN

    htp.init;
    owa_util.redirect_url('f?p=&Custlogin.:1:&APP_SESSION.');

    END IF;

    END;
    }

    Anyway, I would use branches to achieve what you need in your page. One branch for each type of user you would like to redirect... so, for example sending user to page "x" if condition above is met:
    -Condition Type=PL/SQL Expression
    -Expression=APEX_UTIL.CURRENT_USER_IN_GROUP(p_group_name=> 'Customer')

    Edited by: Kleber M on May 23, 2013 12:00 PM
This discussion has been closed.