This content has been marked as final. Show 21 replies
It may not apply in this case for you, but it is good practice to pass as little information through URL's as possible. Meaning that if you can pass some key identifier that will allow you to do a query on the page you are redirecting to and look up the other information that you want on the new page, that is the preferred method.
set these items (P37_DOCKET_NUM,P37_PO_NUM) with these values(\&P37_DOCKET_NUM.\,\&P37_PO_NUM.\)
I strongly suggest avoiding passing string values in the URL - i ran into issues in the past with trying to pass them in the URL but there were countless characters that ended up causing issues. Instead, why dont you have a page process that sets the page values accordingly. Either on the new page as before header, or on the original page as on submit.
:P<new_page>ITEM := :P<oldpage>_ITEM;
Or just have computations on the new page, based on page items, which are from the other page.
Sorry bout that. We do it all the time with links we build up; I thought it would work from the Set These Items With These Values area
Well, This method will work, and you can pass anything you want up to the size limits of the collection column sizes
On the current page, create an after submit PL/SQL procedure as the last procedure in the sequence right before branching. This will put your source item values into an Apex Collection.
On the Target Page, create a Before or After Header procedure to obtain the values you passed in the collection.
DECLARE l_collection_name CONSTANT VARCHAR2(255) := WWV_FLOW.G_INSTANCE; -- WWV_FLOW.G_INSTANCE is your user session number and will keep the collections per user session BEGIN IF APEX_COLLECTION.COLLECTION_EXISTS(p_collection_name => l_collection_name) THEN APEX_COLLECTION.DELETE_COLLECTION(p_collection_name => l_collection_name); END IF; APEX_COLLECTION.CREATE_COLLECTION(p_collection_name => l_collection_name); APEX_COLLECTION.ADD_MEMBER( p_collection_name => l_collection_name, p_c001 => :Page_Item1, p_c002 => :Page_Item2 ); END;
Too bad we can't just put it in the branch setup.
Select c001, c002 INTO :Target_Page_Item1, :Target_Page_Item2 From APEX_COLLECTIONS Where COLLECTION_NAME = WWV_FLOW.G_INSTANCE AND SEQ_ID = 1
Edited by: Bob37 on Mar 19, 2012 8:31 AM
One thing I noticed is on the Set These Items on the Add_Jobs button, you had \P6_PO_NUM\. The backslashes do not belong there, only on the With These Items. I removed those backslashes from around P6_PO_NUM. You might see if that works now. If so. Great. You're done?
Otherwise here is what you need to do to get the collection process to work
On Page 37 then:
-You would change the Add_Jobs to Submit the page, not redirect. Remove the redirect stuff as well.
-Create the after Submit Process which creates the collection record as described above. Substitute your Page Item Names
-Have a branch which fires on the Add_Jobs button and redirects to Page 6 without passing any values.
On Page 6:
Create an After Header PL/SQL process as described above, which is the Select c001, c002..... to pick up the values you are passing. Substitute your page item names in place of the "target_page_items".
What you're doing is using the Apex Collections, thinking of them as a temporary table, where you're writing the values you want to pass into standard table columns and then reading the temporary table to pick up the values on the other side (page 6), where Apex branching and URL building isn't going to have any affect on the data.
By the way, I just tested this in my app, and it worked fine. I was assuming when you said it didn't work, it was something basic rather than your setup.
So, I'm now assuming when you said it didn't work, it was because you had \'s around the P6_PO_NUM in the Set These Items.
set these items (P6_DOCKET_NUM,P6_PO_NUM) with these values(\&P37_DOCKET_NUM.\,\&P37_PO_NUM.\)
Try that again and see if that works for you based on your original setup without any backslashes in the Set These Items specifications
I am getting this error on page 6
ORA-01722: invalid number
Technical Info (only visible for developers)
ora_sqlerrm: ORA-01722: invalid number
ORA-06512: at "SYS.WWV_DBMS_SQL", line 904
ORA-06512: at "APEX_040100.WWV_FLOW_DYNAMIC_EXEC", line 618
ORA-06512: at "APEX_040100.WWV_FLOW_PROCESS", line 128