OAF Scripts and Codes
OAF Scripts and Codes
com/oaf-developer-guide/
XXPoHeaderVOImpl vo = getXXPoHeaderVO1();
row = (XXPoHeaderVO)vo.createRow();
row.setNewRowState(row.STATUS_INITIALIZED);
vo.insertRow(row);
----------------------- RollBack---------------------------
getOADBTransaction().rollback();
------------------ Apply------------------------------------
getTransaction().commit();
--------------------------------------------------------------------------------
if (pageContext.getParameter("Apply") != null)
{
OAApplicationModule am = pageContext.getRootApplicationModule();
//No need for any special exception handling. You can just display the
//confirmation message because the OAF won't reach this code if the post/commit
//fails.
am.invokeMethod("apply");
OAException confirmMessage =
OAException.CONFIRMATION, null);
pageContext.putDialogMessage(confirmMessage);
-------------------------------------------------------------------------------------------
am.invokeMethod("rollback");
pageContext.forwardImmediately("OA.jsp?
page=/search/oracle/apps/PO/searchdemoPRJ/webui/searchPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
false, // retain AM
OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
-------------------------------------------------------------------------------------------------------------
MtlLotNumbersVORowImpl voi=(MtlLotNumbersVORowImpl)(vo.getCurrentRow());
mLotDetailValuesHT.put("StatusId",voi.getStatusId());
-------------------------InitQuery----------------------------------------------
try
catch (Exception e)
executeQuery ();
}//end initQuery ()
-----------------------------------------------------------------------------------------------------
/***************************************** ****************************
****************************** *************************** */
if (vo == null)
vo.initQuery (employeeNumber);
}//end initDetails ()
//VO that is used for both inserts and queries. See View Objects
if (! vo.isPreparedForExecution ())
vo.executeQuery ();
vo.insertRow (row);
row.setNewRowState (Row.STATUS_INITIALIZED);
}//end createEmployee ()
---------------------------Calling Page-----------------------------------------------
pageContext.setForwardURL("OA.jsp?page=/lyf4/oracle/apps/ak/emp/webui/EmployeePG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true,//Retain AM
OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
OAWebBeanConstants.IGNORE_MESSAGES);
---------------------------------------------------------------------------------------------------------------
public void rollbackEmployee()
if (txn.isDirty())
txn.rollback();
}//end rollbackEmployee()
---------------------------------------Firepartial Event-----------------------------------------------------------
try {
XxPprDemoVOImpl vo = getXxPprDemoVO1();
vo.setWhereClause(null);
vo.setWhereClauseParams(null);
vo.setWhereClause("EMPNO = :1");
vo.setWhereClauseParam(0, empNum);
vo.setMaxFetchSize(-1);
vo.executeQuery();
if (row == null) {
return "N";
} catch (Exception e) {
e.printStackTrace();
return "Y";
-------------------------doDML---------------------------------------------------------------
try {
firstEmployee.setCommissionPct(new Number(0.99));
} catch (SQLException e) {
super.doDML(i, transactionEvent);
try
callableStatement =
(OracleCallableStatement)getOADBTransaction().createCallableStatement(callProc,1);
callableStatement.setNUMBER(1, id);
callableStatement.setString(2, code);
callableStatement.setDATE(3, currentDate);
callableStatement.setString(4, "Y");
callableStatement.registerOutParameter(5,OracleTypes.VARCHAR,255);
callableStatement.registerOutParameter(6,OracleTypes.VARCHAR,255);
callableStatement.registerOutParameter(7,OracleTypes.NUMBER,255);
callableStatement.execute();
catch(Exception e)
e.printStackTrace();
finally
{
try
callableStatement.close();
catch(Exception exception2)
throw OAException.wrapperException(exception2);
--------------------------------------------------------------------------------------------------------