Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Need to redirect to another page

RichDWDec 18 2018 — edited Jan 21 2019

Apex 5.1.4

ORDS 18

Apache 2.4

Tomcat 9

I have a page in which a user enters their login ID int a page item (P47_USER) and that entered UserID is saved to session using a plsql 'null;' process.

Then there is a Dynamic Action based on a change to this page item (P47_USER).

The first step in the DA is to check to see if there are rows in a secondary table (AUTH_ANSW) associated with that UserID.  If no rows exist, then I need to redirect to a different page.  This is the DA PLSQL code:

Declare

l_exist number :=1;

l_agentid number;

begin

select id into l_agentid from agent where agent.adname=:P47_USER;

select count(*) into l_exist from AUTH_ANSW where auth_answ.AGENTID = l_agentid;

IF (l_exist=0) then

apex_util.redirect_url (p_url => 'f?p=&APP_ID.:46:&SESSION.');

end if;

end;

The problem I have is that I get an error whenever there are no rows found.

"Ajax call returned server error ORA-20876: Stop APEX Engine for Execute PL/SQL Code."

This looks like this is related to the api call "apex_util.redirect_url" - and it looks correct to me. I must be missing something.  Is there a prohibition against doing a branch like this in a DA?  If so - what are your suggestions on how to re-architect this?

Please chime in and provide some direction.

Thank you.

Rich

This post has been answered by Franck N on Dec 19 2018
Jump to Answer
Comments
Post Details
Added on Dec 18 2018
12 comments
17,880 views