1
votes

I am trying to migrate my application from Apex 4.2 to Apex 5.1

I'll try to describe the complete use-case:

I have a report page with a link for each record which opens a dialog window where users can edit/interact with the record.

The dialog has Previous/Next buttons to allow users to navigate through the records.

When a filter is set on the report, the dialog window should take this into account in the Next/Previous behaviour.

For e.g. if the report filter selects only one row, then the dialog window Next/Previous buttons are disabled because there are no more rows shown by the report to navigate through.

In Apex 4.1, we were doing this by passing the ID of the interactive report (in Javascript through the URL) which was then used by a page process to query the Application Express views in the back-end to identify the currently set filters and use that info to generate a WHERE clause which is then passed to the 'Get Next or Previous Primary Key' process.

Now in Apex 5 we are not able to do this because we don't know the ID of the IR and also we are not sure if we can query the metadata views in the same way.

I would be glad to know what would be the best approach to get the same behaviour in Apex 5.

v_url = 'f?p=' + pAPP_ID + ':' + pPageNo + ':' + pAPP_SESSION + '::::' + pKeyColumn + ',' + pIRReportID + ',' + pModeColumn + ':' + pKeyValue + ',' + $v('apexir_REPORT_ID') + ',' + pMode;

Thanks in advance for the help.

1
What's the problem being solved in the original solution?Scott
The problem is when i click on edit option in any row in my interactive report it should open the browser window with the details of that particular row where edit and delete options will be there. This is happening from a Javascript URL call. It was working fine in apex 4.2 but not in apex 5.Roopesh
Sure, but why do you need the IR report ID in the called page?Scott

1 Answers

1
votes

I do not know why do you need to have the Interactive Report ID on another page. Is this work necessary on many pages or just this one? If it is only in this, you could set a static ID for this report and use the defined ID directly in your URL (image below).

enter image description here

Not sure, but from what I remember ... in the old versions of the apex only one interactive report per page was allowed.

So you could get the ID of this report on the page from that hidden field "apexir_REPORT_ID".

However, in APEX5 they allowed more than one interactive report per page, so this field could not be the same across all interactive reports on a page ... because they should be different for each interactive report.

Because of this (just assuming) ... they have changed the way you access the ID of a certain interactive report on the page. If you do not set the static ID of your report, this hidden field will look like this in your HTML:

enter image description here

But if you set the ID the hidden field will look like this: enter image description here

In this case, to get that number in a value attribute, you can do this:

$v('YOUR_ID_HERE_report_id')
//or
apex.item('YOUR_ID_HERE_report_id').getValue()

You can found that number whenever you want with this select

 select region_id from apex_application_page_regions
 where 
 application_id = :APP_ID AND
 page_id = :APP_PAGE_ID AND
 UPPER(region_name) = UPPER(v_region_name);