Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

Delete Code

String lineRefId =

pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
String
CcMasterID=pageContext.getParameter("CceMasterId").toString();
OAException mainMessage =
new OAException("Are you sure, You want to delete this Record ?",
OAException.WARNING);
OADialogPage dialogPage =
new OADialogPage(OAException.WARNING, mainMessage, null, "",
"");
dialogPage.setOkButtonItemName("DeleteYesButton");
dialogPage.setOkButtonToPost(true);
dialogPage.setNoButtonToPost(true);
dialogPage.setPostToCallingPage(true);
dialogPage.setOkButtonLabel("Yes");
dialogPage.setNoButtonLabel("No");
Hashtable formParams = new Hashtable(1);
formParams.put("lineRefId", lineRefId);
formParams.put("CcMasterID", CcMasterID);
dialogPage.setFormParameters(formParams);
pageContext.redirectToDialogPage(dialogPage);
}
if (pageContext.getParameter("DeleteYesButton") != null) {
String lineRefId =
pageContext.getParameter("lineRefId").toString();
Serializable[] parameters = { lineRefId};
am.invokeMethod("DeleteHeader", parameters);
OAException mainMessage =
new OAException("Record has been Deleted ",
OAException.CONFIRMATION);
pageContext.putDialogMessage(mainMessage);

Calling Procedure

else if
("SubmitForApproval".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM
))) {

String v_variable =
pageContext.getParameter(Parameter").toString();
Serializable[] param = { v_variable };

CallableStatement callableStatement =
am.getOADBTransaction().createCallableStatement("begin package or
procedure(:1,:2,:3); end;",

OADBTransaction.DEFAULT);
try {
callableStatement.setString(1, v_variable);
callableStatement.registerOutParameter(2, Types.VARCHAR);
callableStatement.registerOutParameter(3, Types.VARCHAR);
callableStatement.execute();
String Result= callableStatement.getString(2);
String Username= callableStatement.getString(3);
if (tagValue.equals("S")) {
sop;
} else {
throw new OAException("Error While Sending Approval
Notification",
OAException.ERROR);

}
} catch (Exception e) {
System.out.println(" XX in Catch Block of callableStatement: " +
e.getMessage());
throw new OAException("Error Message",
OAException.ERROR);
}

You might also like