0% found this document useful (0 votes)
38 views2 pages

Rereance Code

This code snippet contains code to delete a record from a database. It first displays a confirmation dialog to the user asking if they want to delete the record. If the user clicks "Yes", it calls a database method to delete the record by its reference ID and displays a confirmation message.

Uploaded by

Moeen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views2 pages

Rereance Code

This code snippet contains code to delete a record from a database. It first displays a confirmation dialog to the user asking if they want to delete the record. If the user clicks "Yes", it calls a database method to delete the record by its reference ID and displays a confirmation message.

Uploaded by

Moeen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 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