Oracle Apps Technical Blog
Total Pageviews
Saturday, 12 December 2020
Raise bundle exceptions using raiseBundledOAAttrValException with example in OAF
import com.sun.java.util.collections.ArrayList;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import oracle.apps.fnd.common.MessageToken;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAAttrValException;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.OAWebBeanTable;
import oracle.apps.icx.por.rcv.server.ReturnItemsVOImpl;
import oracle.apps.icx.por.rcv.webui.RtnSrchCO;
import oracle.jbo.Row;
public class XXRtnSrchCO6 extends RtnSrchCO
{
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
pageContext.writeDiagnostics(this, "Dbg : XXRtnSrchCO Start Process From Request ",1);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
ReturnItemsVOImpl vo1 = (ReturnItemsVOImpl)am.findViewObject("ReturnItemsVO");
String str1 = null;
String str2 = null;
String str3 = null;
String usrId = null;
try
{
str1 = pageContext.getParameter("event");
}
catch(Exception e)
{
pageContext.writeDiagnostics(this, "Dbg : Exception at str1 "+e,1);
}
try
{
str2 = pageContext.getParameter("value");
}
catch(Exception e)
{
pageContext.writeDiagnostics(this, "Dbg : Exception at str2 "+e,1);
}
try
{
str3 = pageContext.getParameter("source");
}
catch(Exception e)
{
pageContext.writeDiagnostics(this, "Dbg : Exception at str3 "+e,1);
}
try
{
usrId = ""+pageContext.getUserId();
}
catch(Exception e)
{
pageContext.writeDiagnostics(this, "Dbg : Exception at usrId "+e,1);
}
pageContext.writeDiagnostics(this, "Dbg : usrId "+usrId,1);
pageContext.writeDiagnostics(this, "Dbg : str1 "+str1,1);
pageContext.writeDiagnostics(this, "Dbg : str2 "+str2,1);
pageContext.writeDiagnostics(this, "Dbg : str3 "+str3,1);
if (("goto".equals(str1)) && ("NavigationBar".equals(str3)) && ("2".equals(str2)))
{
pageContext.writeDiagnostics(this, "Dbg : Next button pressed. ",1);
Object rtnSrchVoName = (String)pageContext.getTransactionValue("RtnSrchVOName");
pageContext.writeDiagnostics(this, "Dbg : rtnSrchVoName "+(String)rtnSrchVoName, 1);
OAWebBeanTable resultsTblBean = (OAWebBeanTable)webBean.findIndexedChildRecursive("ResultsTableRN");
if (resultsTblBean != null)
{
pageContext.writeDiagnostics(this, "Dbg : resultsTblBean Entered", 1);
resultsTblBean.setViewUsageName((String)rtnSrchVoName);
OAViewObject rtnSrchVO = (OAViewObject)am.findViewObject((String)rtnSrchVoName);
if(rtnSrchVO!=null)
{
Row[] headrRow = rtnSrchVO.getAllRowsInRange();
pageContext.writeDiagnostics(this, "Dbg : Length of rtnSrchVO rows is "+headrRow.length, 1);
ArrayList errMsg = new ArrayList();
if(headrRow.length >0)
{
for (int j = 0; j < headrRow.length; j++)
{
Row currRow = headrRow[j];
oracle.jbo.domain.Number returnQty = null;
try
{
returnQty = (oracle.jbo.domain.Number)currRow.getAttribute("ReturnQuantity");
}
catch (Exception ex)
{
pageContext.writeDiagnostics(this,"Dbg : returnQty Exception "+ex,1);
}
pageContext.writeDiagnostics(this,"Dbg : returnQty "+returnQty,1);
if(returnQty!=null)
{
String query4 = "select xx_rcpt_oaf_pkg.is_rcpt_qty_elig(:1) from dual";
String isValidDecimal =null;
try
{
PreparedStatement pStmt = am.getOADBTransaction().createPreparedStatement(query4, 1);
pStmt.setString(1,returnQty.toString());
for(ResultSet rs = pStmt.executeQuery(); rs.next();)
{
if(rs != null)
{
isValidDecimal = rs.getString(1);
}
}
pStmt.close();
}
catch(Exception e)
{
pageContext.writeDiagnostics(this,"Dbg : isValidDecimal Exception "+e,1);
}
pageContext.writeDiagnostics(this,"Dbg : isValidDecimal "+isValidDecimal,1);
if(isValidDecimal!=null && isValidDecimal.length()>0 && isValidDecimal.equalsIgnoreCase("Y"))
{
pageContext.writeDiagnostics(this,"Dbg : Only 2 Decimal places are allowed at Receipt Quantity ",1);
OAAttrValException ex1 = new OAAttrValException(111,rtnSrchVO.getFullName(),currRow.getKey(),"ReturnQuantity",returnQty,"XX","XX_RCPT_QTY_DCML_MSG", null, (byte)0);
errMsg.add(ex1);
}
}
}
if (errMsg.size()> 0)
{
pageContext.writeDiagnostics(this,"Dbg : Throwing Bundle exceptions ",1);
OAAttrValException.raiseBundledOAAttrValException(errMsg);
}
}
}
}
}
pageContext.writeDiagnostics(this, "Dbg : XXRtnSrchCO Process From Request End",1);
super.processFormRequest(pageContext, webBean);
}
}
Displaying Exception Messages in OAF
,OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
if(pageContext.getParameter("item1")!=null)
{
String name=pageContext.getParameter("item6");
throw new OAException(name,OAException.ERROR);
}
if(pageContext.getParameter("item1")!=null)
{
String name=pageContext.getParameter("item6");
throw new OAException(name,OAException.CONFIRMATION);
}
if(pageContext.getParameter("item1")!=null)
{
String name=pageContext.getParameter("item6");
throw new OAException(name,OAException.WARNING);
}
}
Useful OAF Profiles
Personalize Self-Service Defn - To enable the personalization link on every page
FND: Personalization Region Link Enabled - To enable the personalization link on every region
FND: Diagnostics - To enable diagnostics on OAF page
FND: Personalization Seeding Mode - To allow edition of custom personalization
Disable Self-Service Personal - For disabling all personalization’s
Fnd Xliff Export Root Path - Use this profile option to set the root path used to generate the full path where the Xliff files are exported to when users extract their translated personalization using the Extract Translation Files page in OA Personalization Framework. The permissions for the root path directory that you specify must be set to read, write, create for all users, using chmod 777 [dir_path].
Xliff Import Root Path - Use this profile option to set the root path used to derive the full path from where the Xliff files are uploaded when users use the Upload Translations page in OA Personalization Framework to upload translated personalization.
FND: Personalization Document Root Path - Use this profile option to define the root path where personalization documents are exported to or imported from when users use the Database page or the File System page of the Functional Administrator responsibility's Document Manager, respectively. We recommend you set this profile to the $APPL_TOP staging area: $APP_TOP/<CompanyIdentifier>/<CustomProductShortName>/<product-version>/mds/webui of the current deployed environment, where personalization documents are to be imported from or exported to. This profile option should be set at the Site level.
Unable to launch the Java Virtual Machine Located at path: ..\..\jdk\jre\bin\client\jvm.dll
Below error will receive when attempting to install jDeveloper 10g for OAF on a Windows 10 desktop machine.
Error: Unable to launch the Java Virtual Machine Located at path: ..\..\jdk\jre\bin\client\jvm.dll
Solution: Please do the following setup to fix the above issue.
Run regedit (remember to run it as the administrator) from your system
- Expand HKEY_LOCAL_MACHINE
- Expand SOFTWARE
- Expand Microsoft
- Expand Windows
- Expand CurrentVersion
- Expand App Paths
- At App Paths, add a new KEY Name it: jdevW.exe Expand jdevW.exe
- Modify the (DEFAULT) value to the full pathway to the jdeveloper executable
- ex: "c:\jdev\jdevbin\jdev\bin\jdevW.exe"
- Create a new STRING VALUE called PATH and set it value to the jdeveloper pathway
- ex: "c:\Jdev\jdevbin\jdk\jre\bin" Save and close regedit
Sunday, 8 April 2018
OAF Importer commands
Page Importer:
java oracle.jrad.tools.xml.importer.XMLImporter $JAVA_TOP/xx/oracle/apps/po/custom/webui/PoDummyPG.xml -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xxx)(PORT=1522))(CONNECT_DATA=(SERVICE_NAME=XXX)))" -rootdir $JAVA_TOP
JPX Importer:
java oracle.jrad.tools.xml.importer.JPXImporter $JAVA_TOP/xx/oracle/apps/icx/lov/server/XXPrj.jpx -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xxx)(PORT=1522))(CONNECT_DATA=(SERVICE_NAME=xxx)))"
Saturday, 7 April 2018
OAF Apache Bounce Steps in R12.2
Login to Putty
Step 1 : Perform the below steps to Set the environment
login as: appldev
appldev@xxx password: Enter password
[appldev@xxx ~]$ cd ../..
[appldev@xxx ~]$ cd /u01/EBSDEV/APPS
[appldev@xxx APPS]$ . EBSapps.env run
E-Business Suite Environment Information
----------------------------------------
RUN File System : /u01/EBSDEV/APPS/fs1/EBSapps/appl
PATCH File System : /u01/EBSDEV/APPS/fs2/EBSapps/appl
Non-Editioned File System : /u01/EBSDEV/APPS/fs_ne
DB Host: xxx Service/SID: EBSDEV
Sourcing the RUN File System ...
Step 2 : Run the adcgnjar to register the OAF changes to the weblogic server
[appldev@xxx APPS]$ cd $AD_TOP/bin
[appldev@xxx bin]$ adcgnjar
Copyright (c) 2002, 2012 Oracle Corporation
Redwood Shores, California, USA
AD Custom Jar Generation
Version 12.2.0
NOTE: You may not use this utility for custom development
unless you have written permission from Oracle Corporation.
Enter the APPS username: apps
Enter the APPS password:
customall.jar generated successfully.
Step 3 : Perform the below steps to stop the server
[appldev@xxx bin]$ cd $ADMIN_SCRIPTS_HOME
[appldev@xxx scripts]$ admanagedsrvctl.sh stop oacore_server1
You are running admanagedsrvctl.sh version 120.14.12020000.11
Enter the WebLogic Admin password:
Stopping oacore_server1...
Refer /u01/EBSDEV/APPS/fs1/inst/apps/EBSDEV_xxx/logs/appl/admin/log/adoacorectl.txt for details
Server specific logs are located at /u01/EBSDEV/APPS/fs1/FMW_Home/user_projects/domains/EBS_domain_EBSDEV/servers/oacore_server1/logs
admanagedsrvctl.sh: exiting with status 0
admanagedsrvctl.sh: check the logfile /u01/EBSDEV/APPS/fs1/inst/apps/EBSDEV_xxx/logs/appl/admin/log/adoacorectl.txt for more information ...
Step 4 : Perform the below steps to start the server
[appldev@xxx scripts]$ admanagedsrvctl.sh start oacore_server1
You are running admanagedsrvctl.sh version 120.14.12020000.11
Enter the WebLogic Admin password:
Calling txkChkEBSDependecies.pl to perform dependency checks for oacore_server1
*** ALL THE FOLLOWING FILES ARE REQUIRED FOR RESOLVING RUNTIME ERRORS
*** Log File = /u01/EBSDEV/APPS/fs1/inst/apps/EBSDEV_xxx/logs/appl/rgf/TXK/txkChkEBSDependecies_Sun_Feb_25_16_52_39_2018/txkChkEBSDependecies_Sun_Feb_25_16_52_39_2018.log
Perl script txkChkEBSDependecies.pl got executed successfully
Starting oacore_server1...
Server specific logs are located at /u01/EBSDEV/APPS/fs1/FMW_Home/user_projects/domains/EBS_domain_EBSDEV/servers/oacore_server1/logs
admanagedsrvctl.sh: exiting with status 0
admanagedsrvctl.sh: check the logfile /u01/EBSDEV/APPS/fs1/inst/apps/EBSDEV_xxx/logs/appl/admin/log/adoacorectl.txt for more information ...
[appldev@xxx scripts]$
Tuesday, 31 October 2017
Useful Codes Used in OAF -2
write the following code in the AM
public void InsertRecord()
{
InsertVOImpl vo= getInsertVO1();
OADBTransaction trans= getOADBTransaction();
vo.executeQuery();
Row v_row;
v_row = (Row)vo.createRow();
vo.insertRow(v_row);
}
The following code shows the initialization process of AM in controller.
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
InsertRecordsAMImpl am=(InsertRecordsAMImpl)pageContext.getApplicationModule(webBean);
am.InsertRecord();
}
The following code shows the creation of record.
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
InsertRecordsAMImpl am=(InsertRecordsAMImpl)pageContext.getApplicationModule(webBean);
if(pageContext.getParameter("item6")!=null)
{
am.getOADBTransaction().commit();
throw new OAException("Data Created sucsessfully",OAException.CONFIRMATION);
}
}