2
votes

I am trying to do the following:

  • Anonymous user with a unique key enters a code and clicks 'Start Survey'
  • The button needs to call a plsql process to populate some hidden page items.
  • Once the values are set branch to the survey page which will use the hidden items for filtering results.

The Problem

No matter what I have tried so far the items set by the process are null when I get to the next page. I assume this is because it did not submit. The way I have it at the moment is:

  • Button navigates to the next page
  • New process set to when the button is pressed sets the values of the page items.

By the time it gets to the next page they are blank again.

I could set the button to submit and do the branch in the processing but I think the submit would happen before the values are set. I find it confusing what order these things happen in.

Can I please get help with making this work, and is there a good article on understanding this area better?

here is the code from the process that puts the values in:

Begin

select id into :P1_pat_id 
from lic_paticipent
where unique_id = :P1_unique_code;

select sur_id into :P1_sur_id 
from lic_paticipent
where unique_id = :P1_unique_code;

select id into :P1_first_res_id
  from lic_result r
  where r.pat_id = :P1_pat_id
  and   r.sur_id = :P1_sur_id
  and   r.qop_id is null
  and   rownum = 1;

End;

Thanks in advance for your help.

2
can you post the process that is populating the hidden page items?just want to make sure that you are populating the right page items. if you are populating page items of another page, then that is whats wrong with your code.brenners1302
I have added it to the question above, the process populated three items for page 1 and the process is on page 1.AndrewT
so how are you filtering the report in the other page?brenners1302
Just add it to the where clause ie where ID = :P1_first_res_idAndrewT
sorry I meant where ID = :P1_first_res_idAndrewT

2 Answers

3
votes

OK I solved it and it is my playing around with another issue that cased it. I had set the hidden fields to "Always replacing" instead of "Only when null" so the plsql process updated the session but not the item so when I did a submit the null item replaced what the plsql process had set. I had expected that when the session was updated it would update the item also. I worked it out by making the hidden field visible and could see it was blank but had a value when I checked the session state.

enter image description here

2
votes

Hidden page items in your current page cant be used in other pages unless your current page is a global page. You have to pass the value to another page item in the other page.

Try this:

  • Go to the other page and Create hidden items to catch the value to be passed from the first page.

  • Go back to the first page and retain your process and create a branch process. then set it to redirect to another page. then you'll see Set items below. Put your hidden items in the other page in the left side then your hidden items in your current page in the right side in this format &P1_NEW.(with the period)

It should look like this

Set Items

P11_PAT_ID--------------------------&P1_PAT_ID.


P11_SUR_ID--------------------------&P1_SUR_ID.

etc.