Have you recently upgraded from Oracle E-Business R11 to R12 and found yourself unable to launch APEX from the responsibility menu – Part II?

By Andrew Archibald, Senior Consultant for Rocela

Following on from my previous posting, where I discussed the issue with launching APEX applications from custom responsibilities, I have further developed this code to launch APEX in a separate window instead of using the current window. The previous code took the user from their responsibilities menu to APEX but did not allow for easy access back to responsibilities.

So, as I mentioned previously, launching APEX has become harder with R12 and to launch in a separate window is even harder!

There are two issues that have to be overcome;

• First, is the inability of being able to launch APEX through a MOD PL/SQL function
• and second, by default you cannot put a JavaScript call into your form function, such as
javascript:void window.open(http://apex.oracle.com)

However, this can be overridden by changing the profile option “restrict text input” which is used to restrict entering JavaScript in the field. This can be changed however some security concerns have arisen as a result.

So how do you launch in a separate window? Well, you have to use a combination of JavaScript and HTML in your JSP file. You then have to redirect the LaunchApex.jsp back to the responsibilities page and open APEX in a new window.

First off we need to fetch details of the Oracle E-Business responsibilities for our JSP;

String l_apps_launcher = ctx.getProfileStore().getProfile(“APPS_SERVLET_AGENT”);
l_apps_launcher = l_apps_launcher + “/OA.jsp?OAFunc=OAHOMEPAGE”;

This can then be used in the HTML header to redirect the page once the page is loaded. This will take the main window back to the responsibilities menu;

<meta HTTP-EQUIV=”REFRESH” content=”0; url=<%=l_apps_launcher%>”>

Then add in Javascript code in the header to launch APEX in a new window;

<script language=”JavaScript”>
<!–
function open_on_entrance(url,name)
{

new_window = window.open(‘<%=l_launcher%>’,’launchapex’, ‘menubar,resizable,dependent,status,scrollbars,width=1200,height=1100,left=5,top=5’)
}
// –>
</script>

Then lastly, we add an ‘on load’ process to the HTML body tag;

<body onload=”javascript:open_on_entrance()” >

And that’s it! Hopefully you will find this useful. I firmly believe that this reinforces APEX as a great tool to extend Oracle E-Business Suite. What do you think?

Advertisements
%d bloggers like this: