I have 3 pages:
- Classes: a Classic Report that shows a list of classes and summarises attendance
- Class Attendance Report: An Interactive Report that shows a row for each student that attended a class
- Attendance Add / Edit Form
On the Classes page, the Date value is a Link which passes a filter in the URL to the Class Attendance Report, showing only students who attended the class held on this date
On the Class Attendance Report, I want to have a Region Button that, when clicked, goes to the Attendance Add / Edit Form and the Class Date field on this form is automatically populated with the same date value as was being used for the filter on the Interactive Report on the Class Attendance Report Page.
So, I click on the Class Date link for 2013-11-01, this takes me to the Class Attendance Report and filters for students who have been already entered as attending on 2013-11-01. If I click on the "Add Attendance" button, it goes to the Attendance Add / Edit form and the Class Date is automatically set to 2013-11-01.
I assume I need to do this via a Dynamic Action that runs when the "Add Attendance" button on the Class Attendance Report page is clicked?
I'd appreciate any help people can offer with figuring this out!
If you store your date value in session state, you can refer to it from every page within your application and session. So if, for example you have a page item that you use to filter your interactive report, you can refer to this same item on your form page. You do not need a dynamic action for that.
If you provide more details on how you currently filter and navigate throug your pages, I can help you further along.
you are talking about linking of pages. this can easily be done using page items. you can set the value of page items on the destination page and these page items can then do the filtering of records. the setting of the items will have to be done on the page that holds the links
to see an example of setting values using URLs.
let me know if you want more info on this
let me know if this answers your query in the current thread
I managed to find a way to get this working, but it feels 'amateurish'. I essentially created a hidden item on my Class Attendance Report page and explicitly passed the Class Date to this on the link from the Classes page. I then use a Dynamic Action on the "Add Attendance" button to construct a URL that includes the appropriate field and value in the URL that goes to the Add / Edit Attendance Form.
However, as I say above, while this works, it feels like a workaround.
I feel like I should be able to more directly access the values being used behind the scenes.
I'm not sure what other details to give you but I'll try:
On my 'Classic Report' page the date on each row is a link, which, for example, contains this link: "f?p=11512:8:104622533106590::NO:RIR:IREQ_DATEOFCLASS,P8_CLASSFILTERDATE:2013-11-02,2013-…"
Page 8 is an Interactive Report, so I set the filter of the report for the DATEOFCLASS column in the link above to: 2013-11-02.
I also pass the same value to a hidden field on the form called P8_CLASSFILTERDATE.
var href='f?p=&APP_ID.:4:&SESSION.::::P4_DATEOFCLASS:' + $v('P8_CLASSFILTERDATE');
In this way, when you get to Page 4 (which is the form on which you add new students to a class), the DATEOFCLASS field in the form will automatically be the same as the date value that was passed to the Interactive Report.
Thanks again for your help!
You can reference the value of your hidden page item the same way you refer to your session state in the dynamic action url. Use 'f?p=&APP_ID.:4:&SESSION.::::P4_DATEOFCLASS:&P8_CLASSFILTERDATE.' as url. You can change your Add/Edit button from 'Definfed by Dynamic Action' to 'Redirect to Url'. Place the fore mentioned url in the url field.
Your Dyamic Action is now obsolete.
Check this older forum post for some extra info on setting application items: Set APEX application item using PL/SQL
Note that the application item will just be an extra variable that holds the same value as your P8_CLASSFILTERDATE has, so it's a bit abundant