This discussion is archived
1 2 3 Previous Next 42 Replies Latest reply: Apr 30, 2012 2:39 AM by Prabodh Go to original post RSS
  • 30. Re: How to redirect to different page after login in APEX 4.1
    Prabodh Guru
    Currently Being Moderated
    h3. Contrariwise, if it was so, it might be; and if it were so, it would be; but as it isn't, it ain't. That's logic. -- Lewis Carroll

    Once the user Guru navigates away from Page 1 (where the branch decides the landing page) and does not navigate back to Page 1 from any other page, you are free to send the user to any other page using
    a. Links
    b. Tabs
    c. Lists
    d. Any of the navigation means available in Apex.

    In other words, if the user Guru tries to go to Page 2 from Page 6 but does not, then there is something wrong with
    i) the way you are branching on page 6 .
    ii) There is a branch on Page 2 that sends the user away from Page 2

    And you did not mention where you end up when navigating using the link on Page 6.

    Its all about logic. Do you have the scenario on apex.oracle.com application?

    Regards,
  • 31. Re: How to redirect to different page after login in APEX 4.1
    Gurujothi Explorer
    Currently Being Moderated
    Hi Prabodh,
    I have the sample application in
    http://apex.oracle.com/pls/apex/

    This is my login details,
    Workspace- oracle form developer
    username- gurujothi37@yahoo.com
    password- guru

    This is the application name,Please have a look at this,
    Application 62835 - New_Employee


    with respect to this application only the user GURU can go to home page i.e 1st page,
    others redirected to 2nd page, There I set one link to GO_TO Home page but that also not working.

    Thank you.
  • 32. Re: How to redirect to different page after login in APEX 4.1
    Prabodh Guru
    Currently Being Moderated
    Not sure what you are refering to. Here are 2 scenarios I checked and how they worked.
    Scene 1:
    a. Login as Guru
    b. You land on Page 1
    c. Click the Employee tab and you are taken to Page 2
    d. Click the Goto Home link and you end up on Page 1.

    Scene 2
    a. Login as Mishra
    b. You land on Page 2
    c. Click on Goto Home link and you are sent back to Page 2. Mishra cannot go to Page 1

    To me that looks correct.

    Of course, you had a crazy Before Header branch on Login page which I had to disable to login.

    Regards,
  • 33. Re: How to redirect to different page after login in APEX 4.1
    Gurujothi Explorer
    Currently Being Moderated
    Hi Prabodh,
    You are right,
    As you said I understood that during the login except the user GURU others will go to page 2.

    Is this possible to the USER Mishra to go to page 1 when he clicked GO_To home link,?


    Thank you,
    Gurujothi
  • 34. Re: How to redirect to different page after login in APEX 4.1
    Prabodh Guru
    Currently Being Moderated
    Nothing is impossible.
    You have to make the condition on the branch on Page 1 more complex to figure out whether the User is coming from the login page or from other Page.

    Hint: Create another Application Item and set it to Not NULL in the Branch before redirecting to Page 2.


    Regards,

    Updated: Check out the branches on Page 1. And the Computations on Page 2 and 3.

    Edited by: Prabodh on Apr 27, 2012 5:02 PM
  • 35. Re: How to redirect to different page after login in APEX 4.1
    VC Guru
    Currently Being Moderated
    Gurujothi wrote:
    Hi Prabodh,
    You are right,
    As you said I understood that during the login except the user GURU others will go to page 2.

    Is this possible to the USER Mishra to go to page 1 when he clicked GO_To home link,?


    Thank you,
    Gurujothi
    HI Gurujothi,

    I have implemented what you want in your demo application, just look at your page 2 > look at List url and new page item P2_GOTO_PAGE

    Thanks

    Edited by: vdotcherukuri on Apr 27, 2012 12:02 PM
  • 36. Re: How to redirect to different page after login in APEX 4.1
    Gurujothi Explorer
    Currently Being Moderated
    Hi Prabodh,

    Please see this,

    Check it out. User Guru lands on Page 1, other users land on Page 2.

    Here is how it has been done.

    a. The CustomAuthentication function return Boolean, but does not store the user name anywhere. So I changed it.
    b. Created an Application Item named FUSER (you can change the name and code the way you want it).
    c. Changed the CustomAuthentication function to include the following line just before the return statement
    APEX_UTIL.SET_SESSION_STATE('FUSER',upper(p_username));

    So now the username is stored and available for use in the session state.
    d. Added the branch on Page 1, Onload Before Header that has Page 2 as its target.
    e. Made the branch conditional by using the FUSER Appln Item. The condition is FUSER 'GURU', so other users are directed to Page 2.

    Here the branch condition is ,
    Value of item/column in expression1=expression2 right?
    I given FUSER in expression1 and GURU in expression2,
    but redirecting to same page:-(

    Thank you,
  • 37. Re: How to redirect to different page after login in APEX 4.1
    Prabodh Guru
    Currently Being Moderated
    Did you checkout the code in your 62835 application?
    Guru lands on Page 1, Mishra on Page 2 and Rejula on Page 3.

    On Page 1 there are 2 branches.
    The first one redirects to Page 2 and has a "PL/SQL Expression condition"
    :FUSER = 'MISHRA' AND :FFIRST_VISIT is NULL
    The above sends MISHRA to Page 2 on first visit. Once FFIRST_VISIT has been set to not null then MISHRA can go to Page 1.

    The other redirects to Page 3 and has condition
    :FUSER = 'REJULA' AND :FFIRST_VISIT is NULL
    There is no branch with condition
    :FFUSER = 'GURU'
    because Page 1 is the default page for Guru.


    The Page 2 and Page 3 have computations that set the value of FFIRST_VISIT to a not null value.

    Regards,
  • 38. Re: How to redirect to different page after login in APEX 4.1
    Gurujothi Explorer
    Currently Being Moderated
    Hi Prabodh,
    I understood what you said,
    but here everyone access all pages,
    already GURU's default page is 1,only he shold access this page and also all pages he can access,
    but except GURU othrs should not access page 1.
    Whether for all page we have to create FFIRST_VISIT?

    For what it (FFIRST_VISIT) requires?
    How it is possible ?

    Thank you,

    Regards,
    guru
  • 39. Re: How to redirect to different page after login in APEX 4.1
    Prabodh Guru
    Currently Being Moderated
    You had asked
    >
    Is this possible to the USER Mishra to go to page 1 when he clicked GO_To home link,?
    >

    So the application was modified for Mishra (and other users) to first land on Page 2 (or any other page of your choice Rejula /3) and then allow navigation to Page 1 from the link on Page 2 (or the Tab or any other navigation means).

    Forgot your own query?

    FFIRST_VISIT is an Application Item.

    Regard,
  • 40. Re: How to redirect to different page after login in APEX 4.1
    Gurujothi Explorer
    Currently Being Moderated
    Hi Prabodh,
    where we are mentioning that after login by default to which page to go(by default evev if we didnt set any redirection).
    Thank you,
    Gurujothi.
  • 41. Re: How to redirect to different page after login in APEX 4.1
    Gurujothi Explorer
    Currently Being Moderated
    Hi Prabodh,

    Sorry I understood what you have done,
    Now mishra is redirected to page 2 right?
    only he shold access this 2nd page not othres,
    Here I have one page for only one admin user(mishra)
    all other pages are public anyone can access, but page 2 is only for mishra and othes should not access.

    Thank you,
  • 42. Re: How to redirect to different page after login in APEX 4.1
    Prabodh Guru
    Currently Being Moderated
    Now you have changed your Home page from 1 to 4.
    After Login you are always redirected to your Home page.
    So, you have to create branches on Page 4 instead of Page 1.

    Regards,

    Edited by: Prabodh on Apr 30, 2012 3:09 PM
1 2 3 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points