Hello Sir,
to retrieve the status of a form from the logged in user, I did the following:
- created application item 'STATE_OF_FORM'.
- created application process to set the value into the application item
this takes the status from a table and should set it in the application_item.
Unfortunately it doesn't work as hoped, I think the error is in the syntax:
--this is the code to set stored table status into the status application item
declare v_state varchar2(50); begin select fp.STATE into v_state FROM PROCESSSTEPS_FORM fp left outer join USERS u on fp.UUID=u.UUID where u.username=:APP_USER; Apex_Util.Set_Session_State('STATE_OF_FORM', v_state); --exception handling needed otherwise the error 'ORA-01403: no data found' will exception be raised when no_data_found then NULL; end;
What do I do wrong?
Vinish Kapoor
The code seems to be correct.
At what point you are calling this process?
Ana
I call the application process after authentication.
I have the created a button on the page (with the action submit), that should redirect the user to the corresponding page which is stored in the table.
For the branching process I am using the behaviour :Function returning URL (Redirect)
This function should compare the session state of the user (state of form) with the table stored state
for example if 'REQUESTED' in Table ='REQUESTED' in Application Item
then redirect to corresponding page in the table:
Following PL/SQL Code for that:
but I always get the error:
wwv_flow.branch_func_returning_url_error
Vinish Kapoor
The issue seems in your if condition. You are comparing as:
if v_state = v_state
which is wrong.
I think, it should be:
if v_state = v_stored_state
Also, after end if; return the v_page. Following is the complete code:
Ana
I have changed the code again, and used instead of the application process an application computation to set the session value.
Thank you for your help!