How to call an external url from Oracle Apps Function
The below code snippet will help you to call an external application like ADF based or any other websites like google from oracle apps.You can register the function to call the external url.
1) Create A Dummy OAF Page with just a pagelayout
2) Create a controller and use the following code snippet in ProcessRequest.
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
String cholaNavURL = pageContext.getParameter("CholaNavUrl");
if ((cholaNavURL != null) || (!"".equals(cholaNavURL)))
{
//You can add any code here to get the AOL Object values and pass it to the called page as url
//Parameter.This will help you to do extra validation on your called page.
String s = "function cholanavexternal(){document.location='"+cholaNavURL+"';}";
OABodyBean bodyBean = (OABodyBean)pageContext.getRootWebBean();
pageContext.putJavaScriptFunction("cholanavexternal", s);
String javaS = "javascript:cholanavexternal();";
bodyBean.setOnLoad(javaS);
}
else {
throw new OAException("Incorrect Function Setup.Please Contact Your System Administrator",OAException.ERROR);
}
}
3) Register a function like below to test
External URL:
2) Create a controller and use the following code snippet in ProcessRequest.
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
String cholaNavURL = pageContext.getParameter("CholaNavUrl");
if ((cholaNavURL != null) || (!"".equals(cholaNavURL)))
{
//You can add any code here to get the AOL Object values and pass it to the called page as url
//Parameter.This will help you to do extra validation on your called page.
String s = "function cholanavexternal(){document.location='"+cholaNavURL+"';}";
OABodyBean bodyBean = (OABodyBean)pageContext.getRootWebBean();
pageContext.putJavaScriptFunction("cholanavexternal", s);
String javaS = "javascript:cholanavexternal();";
bodyBean.setOnLoad(javaS);
}
else {
throw new OAException("Incorrect Function Setup.Please Contact Your System Administrator",OAException.ERROR);
}
}
3) Register a function like below to test
External URL:
OA.jsp?page=/xxab/oracle/apps/fnd/demo/webui/DemoPG&NavUrl=http://google.com
Fpr Calling an ADF Apps:
OA.jsp?page=/xxab/oracle/apps/fnd/demo/webui/DemoPG&NavUrl=http://demo.orapps12.com:7777/JSFGraphDemo1/faces/PageWithDataAndGraph.jspx
COMMENTS