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!

Redirect is not working from Application Processes

Sanjay SikderSep 7 2024 — edited Sep 7 2024

I have created an application process Process (Point: Before Header) for user page access but its not working. (oracle APEX -24.1.0 and ords -21.2.0.174.1826)

I use the below code..

DECLARE
l_page_id NUMBER := v('APP_PAGE_ID'); -- Use bind variable for APP_PAGE_ID
l_user_id VARCHAR2(4000) := v('APP_USER'); -- Store the user ID
l_url VARCHAR2(4000) := 'http://localhost:8080/ords/r/atml_inv/atml-fiber-dyeing/access-delied';
v_cnt_page NUMBER;
BEGIN
-- Fetch the PAGE_ID from USER_ACCESS table if it exists
SELECT NVL(PAGE_ID, 0)
INTO v_cnt_page
FROM USER_ACCESS
WHERE PAGE_ID = l_page_id
AND P_USERID = l_user_id;

-- Redirect if the user is not authorized for the page
IF v_cnt_page = 0 THEN
owa_util.redirect_url(l_url);
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
owa_util.redirect_url(l_url);
WHEN OTHERS THEN
htp.p('Error: ' || SQLERRM);
END;

Comments
Post Details
Added on Sep 7 2024
4 comments
286 views