Monday 25 June 2012

Query Two are more Table in Report Builder


Query Two or More Table with Help of Join  in Data Model of a Report
select e.eno,e.ename,d.department_id,d.department_name,e.esalary
from
 employeetest e,
 departments  d
where e.eno=d.emp_id


Thursday 14 June 2012

Again with correct syntax of insert statment parameter In oaf page disable button on processrequest method completed


import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageCheckBoxBean;
import oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBean;

import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import com.sun.java.util.collections.HashMap;
import oracle.apps.fnd.framework.OAApplicationModule;
import java.sql.*;

/**
 * Controller for ...
 */
public class HumanResourceController extends OAControllerImpl
{
  public static final String RCS_ID="$Header$";
  public static final boolean RCS_ID_RECORDED =
        VersionInfo.recordClassVersion(RCS_ID, "%packagename%");

  /**
   * Layout and page setup logic for a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processRequest(pageContext, webBean);


System.out.println("I am Human Resource Page processRequest of HR page");
String eno=pageContext.getParameter("EmployeeNo");
String ena=pageContext.getParameter("EmployeeName");
String endgn=pageContext.getParameter("EmployeeDesignation");
String endv=pageContext.getParameter("EmployeeDivision");
String endp=pageContext.getParameter("EmployeeDepartment");
String encty=pageContext.getParameter("EmployeeCity");
//--------
String  empno =pageContext.getParameter("EmpNo");
String emppn=pageContext.getParameter("EmpPositionName");
String emplev=pageContext.getParameter("EmpLevel");
String  empgr =pageContext.getParameter("EmpGrade");
String empres=pageContext.getParameter("EmpResources");
String empdiv=pageContext.getParameter("EmpDivision");
String  empdeptt =pageContext.getParameter("EmpDepartment");
String empsubdeptt=pageContext.getParameter("EmpSubDepartment");
String empfun=pageContext.getParameter("EmpFunction");
String  empcty =pageContext.getParameter("EmpCity");
String emprpt=pageContext.getParameter("EmpReportTo");
String empst=pageContext.getParameter("EmpStatus");
String empct=pageContext.getParameter("EmpCaseType");
//---


String  emprno =pageContext.getParameter("EmpRno");
String emprname=pageContext.getParameter("EmpRname");
String emprdesignation=pageContext.getParameter("EmpRdesignation");
String  emprdepartment =pageContext.getParameter("EmpRdepartment");
String emprgrade=pageContext.getParameter("EmpRgrade");
String emprcity=pageContext.getParameter("EmpRcity");
String emprdol=pageContext.getParameter("EmpRdol");

//-




OAMessageTextInputBean  tibno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empno");
tibno.setValue(pageContext,eno);
tibno.setDisabled(true);

OAMessageTextInputBean  tibname= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empname");
tibname.setValue(pageContext,ena);
tibname.setDisabled(true);

OAMessageTextInputBean  tibdesignation = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empdesignation");
tibdesignation.setValue(pageContext,endgn);
tibdesignation.setDisabled(true);

OAMessageTextInputBean  tibdepartment = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empdepartment");
tibdepartment.setValue(pageContext,endv);
tibdepartment.setDisabled(true);

OAMessageTextInputBean  tibdivision= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empdivision");
tibdivision.setValue(pageContext,endp);
tibdivision.setDisabled(true);

OAMessageTextInputBean  tibcity = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empcity");
tibcity.setValue(pageContext,encty);
tibcity.setDisabled(true);
//------------------------------------------------------------



OAMessageTextInputBean  tibnewno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("newrno");
tibnewno.setValue(pageContext,empno);
tibnewno.setDisabled(true);

OAMessageTextInputBean  tibpname= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("pname");
tibpname.setValue(pageContext,emppn);
tibpname.setDisabled(true);

OAMessageTextInputBean  tibelevel = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("elevel");
tibelevel.setValue(pageContext,emplev);
tibelevel.setDisabled(true);

OAMessageTextInputBean  tibegrade = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("egrade");
tibegrade.setValue(pageContext,empgr);
tibegrade.setDisabled(true);

OAMessageTextInputBean  tiberequired= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("erequired");
tiberequired.setValue(pageContext,empres);
tiberequired.setDisabled(true);

OAMessageTextInputBean  tibedivision = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("edivision");
tibedivision.setValue(pageContext,empdiv);
tibedivision.setDisabled(true);

OAMessageTextInputBean  tibedepartment = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("edepartment");
tibedepartment.setValue(pageContext,empdeptt);
tibedepartment.setDisabled(true);

OAMessageTextInputBean  tibesubdepartment= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("esubdepartment");
tibesubdepartment.setValue(pageContext,empsubdeptt);
tibesubdepartment.setDisabled(true);

OAMessageTextInputBean  tibefunction = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("efunction");
tibefunction.setValue(pageContext,empfun);
tibefunction.setDisabled(true);

OAMessageTextInputBean  tibecity = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("ecity");
tibecity.setValue(pageContext,empcty);
tibecity.setDisabled(true);

OAMessageTextInputBean  tibereportto= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("ereporto");
tibereportto.setValue(pageContext,emprpt);
tibereportto.setDisabled(true);

OAMessageTextInputBean  tibestatus = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("estatus");
tibestatus.setValue(pageContext,empst);
tibestatus.setDisabled(true);
OAMessageTextInputBean  tibecasetype = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("ecasetype");
tibecasetype.setValue(pageContext,empct);
tibecasetype.setDisabled(true);
//------------------------------------------------------------




OAMessageTextInputBean  tibrno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempno");
tibrno.setValue(pageContext,emprno);
tibrno.setDisabled(true);
OAMessageTextInputBean  tibrname= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempname");
tibrname.setValue(pageContext,emprname);
tibrname.setDisabled(true);

OAMessageTextInputBean  tibrdesignation = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempdesignation");
tibrdesignation.setValue(pageContext,emprdesignation);
tibrdesignation.setDisabled(true);

OAMessageTextInputBean  tibrdivision = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempdivision");
tibrdivision.setValue(pageContext,emprdepartment);
tibrdivision.setDisabled(true);

OAMessageTextInputBean  tibrgrade= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempgrade");
tibrgrade.setValue(pageContext,emprgrade);
tibrgrade.setDisabled(true);

OAMessageTextInputBean  tibrcity = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempcity");
tibrcity.setValue(pageContext,emprcity);
tibrcity.setDisabled(true);

OAMessageTextInputBean  tibrdol = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rdol");
tibrdol.setValue(pageContext,emprdol);
tibrdol.setDisabled(true);
//---------------------

  if("2".equals(pageContext.getParameter("x"))){
  OAMessageTextInputBean  tibnewno1 = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("newrno");
  tibnewno1.setDisabled(true);
  OAMessageTextInputBean  tibhrcommet1 = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("hrcomments");
  tibhrcommet1.setDisabled(true);
  OAMessageCheckBoxBean  cbhrvacan1 = (OAMessageCheckBoxBean)webBean.findIndexedChildRecursive("vacancy");
  cbhrvacan1.setDisabled(true);
  OAMessageTextInputBean  tibhrjustify1 = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("justify");
   tibhrjustify1.setDisabled(true);

   OASubmitButtonBean  hrcombtn = (OASubmitButtonBean)webBean.findIndexedChildRecursive("SubmitComments");
  hrcombtn.setDisabled(true);
     }//end if

//-----
if("3".equals(pageContext.getParameter("y"))){
  OAMessageTextInputBean  tibrefno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("refno");
  tibrefno.setValue(pageContext,empno);
  tibrefno.setDisabled(true);

  OAMessageTextInputBean  tibheadCount = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("headCount");
  tibheadCount.setDisabled(true);

  OAMessageTextInputBean  tibheadcountdiv = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("headcountdiv");
  tibheadcountdiv.setDisabled(true);
 
  OAMessageTextInputBean  tibheadcountdept = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("headcountdept");
  tibheadcountdept.setDisabled(true);

  OAMessageTextInputBean  tibbudgetedheadcount = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("budgetedheadcount");
  tibbudgetedheadcount.setDisabled(true);
 
  OAMessageTextInputBean  tibbudgetedHeadcountDiv = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("budgetedHeadcountDiv");
  tibbudgetedHeadcountDiv.setDisabled(true);
 
  OAMessageTextInputBean  tibbudgetedheadcountdept = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("budgetedheadcountdept");
   tibbudgetedheadcountdept.setDisabled(true);

   OASubmitButtonBean  workbtn = (OASubmitButtonBean)webBean.findIndexedChildRecursive("workforcebtn");
  workbtn.setDisabled(true);
     }//end if
//----

if("4".equals(pageContext.getParameter("z"))){
  OAMessageTextInputBean  tibvadate = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("vadate");
  tibvadate.setDisabled(true);

  OAMessageTextInputBean  tibvareDate = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("vareDate");
  tibvareDate.setDisabled(true);
 
  OAMessageTextInputBean  tibrefCloseDate = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("refCloseDate");
  tibrefCloseDate.setDisabled(true);

  OASubmitButtonBean  recbtn = (OASubmitButtonBean)webBean.findIndexedChildRecursive("submitRecruitment");
  recbtn.setDisabled(true);
 }//end if

//----

if("5".equals(pageContext.getParameter("a"))){

  OAMessageTextInputBean  tibapprovaltext = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("approvaltext");
  tibapprovaltext.setDisabled(true);

  OASubmitButtonBean  apbtn = (OASubmitButtonBean)webBean.findIndexedChildRecursive("SubmitApproval");
  apbtn.setDisabled(true);

 }//end if






   
}

  /**
   * Procedure to handle form submissions for form elements in
   * a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);

    if(pageContext.getParameter("SubmitComments")!=null){
   OAMessageTextInputBean  tibnewno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("newrno");
   String reqno=(String)tibnewno.getValue(pageContext);

   OAMessageTextInputBean  tibhrcommet = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("hrcomments");
   String hrcoment=(String)tibhrcommet.getValue(pageContext);


   OAMessageCheckBoxBean  cbhrvacan = (OAMessageCheckBoxBean)webBean.findIndexedChildRecursive("vacancy");
   String hrvacancy=(String)cbhrvacan.getValue(pageContext);
 

   OAMessageTextInputBean  tibhrjustify = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("justify");
   String hrjustify=(String)tibhrjustify.getValue(pageContext);
 
   System.out.println("Do the Updatation regarding EmpRequisitionNo.==="+reqno);
   OAApplicationModule am=pageContext.getApplicationModule(webBean);

try{
Connection conn =am.getOADBTransaction().getJdbcConnection();
Statement stmt = conn.createStatement();
int r=stmt.executeUpdate("update employeerequisitiondetail  set commentsByDepttNHR='"+hrcoment+"',Vacancy2bAnnounced='"+hrvacancy+"',justification='"+hrjustify+"' where employeerequistionno="+reqno+" ");
                                                           
System.out.println("I am in TOP ProcessFormRequest  Succesfully if result ====="+r);
am.getOADBTransaction().commit();
stmt.close();
}catch(Exception e){System.out.println(e.toString());}

HashMap params = new HashMap();
params.put("x","2");
pageContext.setForwardURLToCurrentPage(params, true, OAWebBeanConstants.ADD_BREAD_CRUMB_NO,OAWebBeanConstants.IGNORE_MESSAGES);
    }




if(pageContext.getParameter("workforcebtn")!=null){
 OAMessageTextInputBean  tibnewrf = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("newrno");
 String reqrf=(String)tibnewrf.getValue(pageContext);



OAMessageTextInputBean  tibhrrefno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("refno");
String hrrefno=(String)tibhrrefno.getValue(pageContext);

OAMessageTextInputBean  tibhrheadcount = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("headCount");
String hrheadcount=(String)tibhrheadcount.getValue(pageContext);

OAMessageTextInputBean  tibhrheadcountdiv = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("headcountdiv");
String hrheadcountdiv=(String)tibhrheadcountdiv.getValue(pageContext);

OAMessageTextInputBean  tibhrheadcountdept = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("headcountdept");
String hrheadcountdept=(String)tibhrheadcountdept.getValue(pageContext);

OAMessageTextInputBean  tibhrbudgetedheadcount = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("budgetedheadcount");
String hrbudgetedheadcount=(String)tibhrbudgetedheadcount.getValue(pageContext);

OAMessageTextInputBean  tibhrbudgetedHeadcountDiv = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("budgetedHeadcountDiv");
String hrbudgetedHeadcountDiv=(String)tibhrbudgetedHeadcountDiv.getValue(pageContext);

OAMessageTextInputBean  tibhrbudgetedheadcountdept = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("budgetedheadcountdept");
String hrbudgetedheadcountdept=(String)tibhrbudgetedheadcountdept.getValue(pageContext);


System.out.println("Do the Updatation regarding EmpRequisitionNo for WorkForce with param-3.==="+reqrf);
 OAApplicationModule am=pageContext.getApplicationModule(webBean);


try{
Connection conn =am.getOADBTransaction().getJdbcConnection();
Statement stmt = conn.createStatement();
int r=stmt.executeUpdate("insert into HRWSA(HRREFNO,HEADCOUNTOB,HEADCOUNTDIV,HEADCOUNTDEPT,HEADCOUNTBUG,HEANDCOUNTBUGDIV,HEANDCOUNTBUGDEPT)  values('"+reqrf+"','"+hrheadcount+"','"+hrheadcountdiv+"','"+hrheadcountdept+"','"+hrbudgetedheadcount+"','"+hrbudgetedHeadcountDiv+"','"+hrbudgetedheadcountdept+"')");
                                                           
System.out.println("I am in TOP ProcessFormRequest  Succesfully if result ====="+r);
am.getOADBTransaction().commit();
stmt.close();
}catch(Exception e){System.out.println(e.toString());}
HashMap params = new HashMap();
params.put("y","3");
pageContext.setForwardURLToCurrentPage(params, true, OAWebBeanConstants.ADD_BREAD_CRUMB_NO,OAWebBeanConstants.IGNORE_MESSAGES);

   }//end if hr
 

//---


if(pageContext.getParameter("submitRecruitment")!=null){

OAMessageTextInputBean  tibrevadate = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("vadate");
String revadate=(String)tibrevadate.getValue(pageContext);


OAMessageTextInputBean  tibrevareDate = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("vareDate");
String revareDate=(String)tibrevareDate.getValue(pageContext);

OAMessageTextInputBean  tibrerefCloseDate = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("refCloseDate");
String rerefCloseDate=(String)tibrerefCloseDate.getValue(pageContext);


OAMessageTextInputBean  tibrfn = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("newrno");
String rfn=(String)tibrfn.getValue(pageContext);

System.out.println("Do the Updatation regarding EmpRequisitionNo. for Recruitment with param-4-z==="+rfn);
 OAApplicationModule am=pageContext.getApplicationModule(webBean);


try{
Connection conn =am.getOADBTransaction().getJdbcConnection();
Statement stmt = conn.createStatement();
int r=stmt.executeUpdate("insert into RecruitOperation(Rerefno,Vacananndate,Vacanreopendate,Refclosuredate)  values('"+rfn+"','"+revadate+"','"+revareDate+"','"+rerefCloseDate+"')");
                                                           
System.out.println("I am in TOP ProcessFormRequest  Succesfully if result ====="+r);
am.getOADBTransaction().commit();
stmt.close();
}catch(Exception e){System.out.println(e.toString());}
HashMap params = new HashMap();
params.put("z","4");
pageContext.setForwardURLToCurrentPage(params, true, OAWebBeanConstants.ADD_BREAD_CRUMB_NO,OAWebBeanConstants.IGNORE_MESSAGES);

   }//end if Recu

//---
if(pageContext.getParameter("SubmitApproval")!=null){

OAMessageTextInputBean  tibapprovaltext = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("approvaltext");
String approvaltext=(String)tibapprovaltext.getValue(pageContext);

OAMessageTextInputBean  tibsn = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("newrno");
String num=(String)tibsn.getValue(pageContext);

System.out.println("Do the Updatation regarding EmpRequisitionNo for Approvals with param 5-a.==="+num);
 OAApplicationModule am=pageContext.getApplicationModule(webBean);

try{
Connection conn =am.getOADBTransaction().getJdbcConnection();
Statement stmt = conn.createStatement();
int r=stmt.executeUpdate("insert into approvalsncomment(rn,approvals) values('"+num+"','"+approvaltext+"')");
                                                         
System.out.println("I am in TOP ProcessFormRequest  Succesfully if result ====="+r);
am.getOADBTransaction().commit();
stmt.close();
}catch(Exception e){System.out.println(e.toString());}
HashMap params = new HashMap();
params.put("a","5");
pageContext.setForwardURLToCurrentPage(params, true, OAWebBeanConstants.ADD_BREAD_CRUMB_NO,OAWebBeanConstants.IGNORE_MESSAGES);

   }//end if appro











   
  }
 
}

Wednesday 13 June 2012

How insert values in table directly and call processrequest many time with different case on same oaf Page


import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageCheckBoxBean;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import com.sun.java.util.collections.HashMap;
import oracle.apps.fnd.framework.OAApplicationModule;
import java.sql.*;

/**
 * Controller for ...
 */
public class HumanResourceController extends OAControllerImpl
{
  public static final String RCS_ID="$Header$";
  public static final boolean RCS_ID_RECORDED =
        VersionInfo.recordClassVersion(RCS_ID, "%packagename%");

  /**
   * Layout and page setup logic for a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processRequest(pageContext, webBean);


System.out.println("I am Human Resource Page processRequest of HR page");
String eno=pageContext.getParameter("EmployeeNo");
String ena=pageContext.getParameter("EmployeeName");
String endgn=pageContext.getParameter("EmployeeDesignation");
String endv=pageContext.getParameter("EmployeeDivision");
String endp=pageContext.getParameter("EmployeeDepartment");
String encty=pageContext.getParameter("EmployeeCity");
//--------
String  empno =pageContext.getParameter("EmpNo");
String emppn=pageContext.getParameter("EmpPositionName");
String emplev=pageContext.getParameter("EmpLevel");
String  empgr =pageContext.getParameter("EmpGrade");
String empres=pageContext.getParameter("EmpResources");
String empdiv=pageContext.getParameter("EmpDivision");
String  empdeptt =pageContext.getParameter("EmpDepartment");
String empsubdeptt=pageContext.getParameter("EmpSubDepartment");
String empfun=pageContext.getParameter("EmpFunction");
String  empcty =pageContext.getParameter("EmpCity");
String emprpt=pageContext.getParameter("EmpReportTo");
String empst=pageContext.getParameter("EmpStatus");
String empct=pageContext.getParameter("EmpCaseType");
//---


String  emprno =pageContext.getParameter("EmpRno");
String emprname=pageContext.getParameter("EmpRname");
String emprdesignation=pageContext.getParameter("EmpRdesignation");
String  emprdepartment =pageContext.getParameter("EmpRdepartment");
String emprgrade=pageContext.getParameter("EmpRgrade");
String emprcity=pageContext.getParameter("EmpRcity");
String emprdol=pageContext.getParameter("EmpRdol");

//-




OAMessageTextInputBean  tibno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empno");
tibno.setValue(pageContext,eno);
tibno.setDisabled(true);

OAMessageTextInputBean  tibname= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empname");
tibname.setValue(pageContext,ena);
tibname.setDisabled(true);

OAMessageTextInputBean  tibdesignation = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empdesignation");
tibdesignation.setValue(pageContext,endgn);
tibdesignation.setDisabled(true);

OAMessageTextInputBean  tibdepartment = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empdepartment");
tibdepartment.setValue(pageContext,endv);
tibdepartment.setDisabled(true);

OAMessageTextInputBean  tibdivision= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empdivision");
tibdivision.setValue(pageContext,endp);
tibdivision.setDisabled(true);

OAMessageTextInputBean  tibcity = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empcity");
tibcity.setValue(pageContext,encty);
tibcity.setDisabled(true);
//------------------------------------------------------------



OAMessageTextInputBean  tibnewno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("newrno");
tibnewno.setValue(pageContext,empno);
tibnewno.setDisabled(true);

OAMessageTextInputBean  tibpname= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("pname");
tibpname.setValue(pageContext,emppn);
tibpname.setDisabled(true);

OAMessageTextInputBean  tibelevel = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("elevel");
tibelevel.setValue(pageContext,emplev);
tibelevel.setDisabled(true);

OAMessageTextInputBean  tibegrade = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("egrade");
tibegrade.setValue(pageContext,empgr);
tibegrade.setDisabled(true);

OAMessageTextInputBean  tiberequired= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("erequired");
tiberequired.setValue(pageContext,empres);
tiberequired.setDisabled(true);

OAMessageTextInputBean  tibedivision = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("edivision");
tibedivision.setValue(pageContext,empdiv);
tibedivision.setDisabled(true);

OAMessageTextInputBean  tibedepartment = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("edepartment");
tibedepartment.setValue(pageContext,empdeptt);
tibedepartment.setDisabled(true);

OAMessageTextInputBean  tibesubdepartment= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("esubdepartment");
tibesubdepartment.setValue(pageContext,empsubdeptt);
tibesubdepartment.setDisabled(true);

OAMessageTextInputBean  tibefunction = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("efunction");
tibefunction.setValue(pageContext,empfun);
tibefunction.setDisabled(true);

OAMessageTextInputBean  tibecity = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("ecity");
tibecity.setValue(pageContext,empcty);
tibecity.setDisabled(true);

OAMessageTextInputBean  tibereportto= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("ereporto");
tibereportto.setValue(pageContext,emprpt);
tibereportto.setDisabled(true);

OAMessageTextInputBean  tibestatus = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("estatus");
tibestatus.setValue(pageContext,empst);
tibestatus.setDisabled(true);
OAMessageTextInputBean  tibecasetype = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("ecasetype");
tibecasetype.setValue(pageContext,empct);
tibecasetype.setDisabled(true);
//------------------------------------------------------------




OAMessageTextInputBean  tibrno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempno");
tibrno.setValue(pageContext,emprno);
tibrno.setDisabled(true);
OAMessageTextInputBean  tibrname= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempname");
tibrname.setValue(pageContext,emprname);
tibrname.setDisabled(true);

OAMessageTextInputBean  tibrdesignation = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempdesignation");
tibrdesignation.setValue(pageContext,emprdesignation);
tibrdesignation.setDisabled(true);

OAMessageTextInputBean  tibrdivision = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempdivision");
tibrdivision.setValue(pageContext,emprdepartment);
tibrdivision.setDisabled(true);

OAMessageTextInputBean  tibrgrade= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempgrade");
tibrgrade.setValue(pageContext,emprgrade);
tibrgrade.setDisabled(true);

OAMessageTextInputBean  tibrcity = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempcity");
tibrcity.setValue(pageContext,emprcity);
tibrcity.setDisabled(true);

OAMessageTextInputBean  tibrdol = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rdol");
tibrdol.setValue(pageContext,emprdol);
tibrdol.setDisabled(true);
//---------------------

  if("2".equals(pageContext.getParameter("x"))){
  OAMessageTextInputBean  tibnewno1 = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("newrno");
  tibnewno1.setDisabled(true);
  OAMessageTextInputBean  tibhrcommet1 = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("hrcomments");
  tibhrcommet1.setDisabled(true);
  OAMessageCheckBoxBean  cbhrvacan1 = (OAMessageCheckBoxBean)webBean.findIndexedChildRecursive("vacancy");
  cbhrvacan1.setDisabled(true);
  OAMessageTextInputBean  tibhrjustify1 = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("justify");
   tibhrjustify1.setDisabled(true);
     }//end if

//-----
if("3".equals(pageContext.getParameter("y"))){
  OAMessageTextInputBean  tibrefno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("refno");
  tibrefno.setValue(pageContext,empno);
  tibrefno.setDisabled(true);

  OAMessageTextInputBean  tibheadCount = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("headCount");
  tibheadCount.setDisabled(true);

  OAMessageTextInputBean  tibheadcountdiv = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("headcountdiv");
  tibheadcountdiv.setDisabled(true);
 
  OAMessageTextInputBean  tibheadcountdept = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("headcountdept");
  tibheadcountdept.setDisabled(true);

  OAMessageTextInputBean  tibbudgetedheadcount = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("budgetedheadcount");
  tibbudgetedheadcount.setDisabled(true);
 
  OAMessageTextInputBean  tibbudgetedHeadcountDiv = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("budgetedHeadcountDiv");
  tibbudgetedHeadcountDiv.setDisabled(true);
 
  OAMessageTextInputBean  tibbudgetedheadcountdept = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("budgetedheadcountdept");
   tibbudgetedheadcountdept.setDisabled(true);
     }//end if
//----

if("4".equals(pageContext.getParameter("z"))){
  OAMessageTextInputBean  tibvadate = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("vadate");
  tibvadate.setDisabled(true);

  OAMessageTextInputBean  tibvareDate = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("vareDate");
  tibvareDate.setDisabled(true);
 
  OAMessageTextInputBean  tibrefCloseDate = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("refCloseDate");
  tibrefCloseDate.setDisabled(true);
 }//end if






   
}

  /**
   * Procedure to handle form submissions for form elements in
   * a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);

    if(pageContext.getParameter("SubmitComments")!=null){
   OAMessageTextInputBean  tibnewno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("newrno");
   String reqno=(String)tibnewno.getValue(pageContext);

   OAMessageTextInputBean  tibhrcommet = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("hrcomments");
   String hrcoment=(String)tibhrcommet.getValue(pageContext);


   OAMessageCheckBoxBean  cbhrvacan = (OAMessageCheckBoxBean)webBean.findIndexedChildRecursive("vacancy");
   String hrvacancy=(String)cbhrvacan.getValue(pageContext);
 

   OAMessageTextInputBean  tibhrjustify = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("justify");
   String hrjustify=(String)tibhrjustify.getValue(pageContext);
 
   System.out.println("Do the Updatation regarding EmpRequisitionNo.==="+reqno);
   OAApplicationModule am=pageContext.getApplicationModule(webBean);

try{
Connection conn =am.getOADBTransaction().getJdbcConnection();
Statement stmt = conn.createStatement();
int r=stmt.executeUpdate("update employeerequisitiondetail  set commentsByDepttNHR='"+hrcoment+"',Vacancy2bAnnounced='"+hrvacancy+"',justification='"+hrjustify+"' where employeerequistionno="+reqno+" ");
                                                           
System.out.println("I am in TOP ProcessFormRequest  Succesfully if result ====="+r);
am.getOADBTransaction().commit();
stmt.close();
}catch(Exception e){System.out.println(e.toString());}

HashMap params = new HashMap();
params.put("x","2");
pageContext.setForwardURLToCurrentPage(params, true, OAWebBeanConstants.ADD_BREAD_CRUMB_NO,OAWebBeanConstants.IGNORE_MESSAGES);
    }




if(pageContext.getParameter("workforcebtn")!=null){
 OAMessageTextInputBean  tibnewrf = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("newrno");
 String reqrf=(String)tibnewrf.getValue(pageContext);



OAMessageTextInputBean  tibhrrefno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("refno");
String hrrefno=(String)tibhrrefno.getValue(pageContext);

OAMessageTextInputBean  tibhrheadcount = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("headCount");
String hrheadcount=(String)tibhrheadcount.getValue(pageContext);

OAMessageTextInputBean  tibhrheadcountdiv = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("headcountdiv");
String hrheadcountdiv=(String)tibhrheadcountdiv.getValue(pageContext);

OAMessageTextInputBean  tibhrheadcountdept = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("headcountdept");
String hrheadcountdept=(String)tibhrheadcountdept.getValue(pageContext);

OAMessageTextInputBean  tibhrbudgetedheadcount = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("budgetedheadcount");
String hrbudgetedheadcount=(String)tibhrbudgetedheadcount.getValue(pageContext);

OAMessageTextInputBean  tibhrbudgetedHeadcountDiv = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("budgetedHeadcountDiv");
String hrbudgetedHeadcountDiv=(String)tibhrbudgetedHeadcountDiv.getValue(pageContext);

OAMessageTextInputBean  tibhrbudgetedheadcountdept = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("budgetedheadcountdept");
String hrbudgetedheadcountdept=(String)tibhrbudgetedheadcountdept.getValue(pageContext);


System.out.println("Do the Updatation regarding EmpRequisitionNo.==="+reqrf);
 OAApplicationModule am=pageContext.getApplicationModule(webBean);


try{
Connection conn =am.getOADBTransaction().getJdbcConnection();
Statement stmt = conn.createStatement();
int r=stmt.executeUpdate("insert into HRWSA(HRREFNO,HEADCOUNTOB,HEADCOUNTDIV,HEADCOUNTDEPT,HEADCOUNTBUG,HEANDCOUNTBUGDIV,HEANDCOUNTBUGDEPT)  values("+reqrf+","+hrheadcount+","+hrheadcountdiv+","+hrheadcountdept+","+hrbudgetedheadcount+","+hrbudgetedHeadcountDiv+","+hrbudgetedheadcountdept+")");
                                                           
System.out.println("I am in TOP ProcessFormRequest  Succesfully if result ====="+r);
am.getOADBTransaction().commit();
stmt.close();
}catch(Exception e){System.out.println(e.toString());}
HashMap params = new HashMap();
params.put("y","3");
pageContext.setForwardURLToCurrentPage(params, true, OAWebBeanConstants.ADD_BREAD_CRUMB_NO,OAWebBeanConstants.IGNORE_MESSAGES);

   }//end if hr
 

//---


if(pageContext.getParameter("submitRecruitment")!=null){

OAMessageTextInputBean  tibrevadate = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("vadate");
String revadate=(String)tibrevadate.getValue(pageContext);


OAMessageTextInputBean  tibrevareDate = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("vareDate");
String revareDate=(String)tibrevareDate.getValue(pageContext);

OAMessageTextInputBean  tibrerefCloseDate = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("refCloseDate");
String rerefCloseDate=(String)tibrerefCloseDate.getValue(pageContext);


OAMessageTextInputBean  tibrfn = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("newrno");
String rfn=(String)tibrfn.getValue(pageContext);

System.out.println("Do the Updatation regarding EmpRequisitionNo.==="+rfn);
 OAApplicationModule am=pageContext.getApplicationModule(webBean);


try{
Connection conn =am.getOADBTransaction().getJdbcConnection();
Statement stmt = conn.createStatement();

int r=stmt.executeUpdate("insert into recruitOperation(Rerefno,Vacananndate,Vacanreopendate,Refclosuredate)  values("+rfn+","+revadate+","+revareDate+","+rerefCloseDate+")");
                                                           
System.out.println("I am in TOP ProcessFormRequest  Succesfully if result ====="+r);
am.getOADBTransaction().commit();
stmt.close();
}catch(Exception e){System.out.println(e.toString());}
HashMap params = new HashMap();
params.put("y","4");
pageContext.setForwardURLToCurrentPage(params, true, OAWebBeanConstants.ADD_BREAD_CRUMB_NO,OAWebBeanConstants.IGNORE_MESSAGES);

   }//end if hr





   
  }
 
}

call processRequest method 2nd times of the OA Page using setForwardURLCurrentPage() method


import com.sun.java.util.collections.HashMap;
import oracle.apps.fnd.framework.OAApplicationModule;
import java.sql.*;

/**
 * Controller for ...
 */
public class HumanResourceController extends OAControllerImpl
{
  public static final String RCS_ID="$Header$";
  public static final boolean RCS_ID_RECORDED =
        VersionInfo.recordClassVersion(RCS_ID, "%packagename%");

  /**
   * Layout and page setup logic for a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processRequest(pageContext, webBean);


System.out.println("I am Human Resource Page processRequest of HR page");
String eno=pageContext.getParameter("EmployeeNo");
String ena=pageContext.getParameter("EmployeeName");
String endgn=pageContext.getParameter("EmployeeDesignation");
String endv=pageContext.getParameter("EmployeeDivision");
String endp=pageContext.getParameter("EmployeeDepartment");
String encty=pageContext.getParameter("EmployeeCity");
//--------
String  empno =pageContext.getParameter("EmpNo");
String emppn=pageContext.getParameter("EmpPositionName");
String emplev=pageContext.getParameter("EmpLevel");
String  empgr =pageContext.getParameter("EmpGrade");
String empres=pageContext.getParameter("EmpResources");
String empdiv=pageContext.getParameter("EmpDivision");
String  empdeptt =pageContext.getParameter("EmpDepartment");
String empsubdeptt=pageContext.getParameter("EmpSubDepartment");
String empfun=pageContext.getParameter("EmpFunction");
String  empcty =pageContext.getParameter("EmpCity");
String emprpt=pageContext.getParameter("EmpReportTo");
String empst=pageContext.getParameter("EmpStatus");
String empct=pageContext.getParameter("EmpCaseType");
//---


String  emprno =pageContext.getParameter("EmpRno");
String emprname=pageContext.getParameter("EmpRname");
String emprdesignation=pageContext.getParameter("EmpRdesignation");
String  emprdepartment =pageContext.getParameter("EmpRdepartment");
String emprgrade=pageContext.getParameter("EmpRgrade");
String emprcity=pageContext.getParameter("EmpRcity");
String emprdol=pageContext.getParameter("EmpRdol");

//-




OAMessageTextInputBean  tibno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empno");
tibno.setValue(pageContext,eno);
tibno.setDisabled(true);

OAMessageTextInputBean  tibname= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empname");
tibname.setValue(pageContext,ena);
tibname.setDisabled(true);

OAMessageTextInputBean  tibdesignation = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empdesignation");
tibdesignation.setValue(pageContext,endgn);
tibdesignation.setDisabled(true);

OAMessageTextInputBean  tibdepartment = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empdepartment");
tibdepartment.setValue(pageContext,endv);
tibdepartment.setDisabled(true);

OAMessageTextInputBean  tibdivision= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empdivision");
tibdivision.setValue(pageContext,endp);
tibdivision.setDisabled(true);

OAMessageTextInputBean  tibcity = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empcity");
tibcity.setValue(pageContext,encty);
tibcity.setDisabled(true);
//------------------------------------------------------------



OAMessageTextInputBean  tibnewno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("newrno");
tibnewno.setValue(pageContext,empno);
tibnewno.setDisabled(true);

OAMessageTextInputBean  tibpname= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("pname");
tibpname.setValue(pageContext,emppn);
tibpname.setDisabled(true);

OAMessageTextInputBean  tibelevel = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("elevel");
tibelevel.setValue(pageContext,emplev);
tibelevel.setDisabled(true);

OAMessageTextInputBean  tibegrade = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("egrade");
tibegrade.setValue(pageContext,empgr);
tibegrade.setDisabled(true);

OAMessageTextInputBean  tiberequired= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("erequired");
tiberequired.setValue(pageContext,empres);
tiberequired.setDisabled(true);

OAMessageTextInputBean  tibedivision = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("edivision");
tibedivision.setValue(pageContext,empdiv);
tibedivision.setDisabled(true);

OAMessageTextInputBean  tibedepartment = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("edepartment");
tibedepartment.setValue(pageContext,empdeptt);
tibedepartment.setDisabled(true);

OAMessageTextInputBean  tibesubdepartment= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("esubdepartment");
tibesubdepartment.setValue(pageContext,empsubdeptt);
tibesubdepartment.setDisabled(true);

OAMessageTextInputBean  tibefunction = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("efunction");
tibefunction.setValue(pageContext,empfun);
tibefunction.setDisabled(true);

OAMessageTextInputBean  tibecity = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("ecity");
tibecity.setValue(pageContext,empcty);
tibecity.setDisabled(true);

OAMessageTextInputBean  tibereportto= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("ereporto");
tibereportto.setValue(pageContext,emprpt);
tibereportto.setDisabled(true);

OAMessageTextInputBean  tibestatus = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("estatus");
tibestatus.setValue(pageContext,empst);
tibestatus.setDisabled(true);
OAMessageTextInputBean  tibecasetype = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("ecasetype");
tibecasetype.setValue(pageContext,empct);
tibecasetype.setDisabled(true);
//------------------------------------------------------------




OAMessageTextInputBean  tibrno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempno");
tibrno.setValue(pageContext,emprno);
tibrno.setDisabled(true);
OAMessageTextInputBean  tibrname= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempname");
tibrname.setValue(pageContext,emprname);
tibrname.setDisabled(true);

OAMessageTextInputBean  tibrdesignation = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempdesignation");
tibrdesignation.setValue(pageContext,emprdesignation);
tibrdesignation.setDisabled(true);

OAMessageTextInputBean  tibrdivision = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempdivision");
tibrdivision.setValue(pageContext,emprdepartment);
tibrdivision.setDisabled(true);

OAMessageTextInputBean  tibrgrade= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempgrade");
tibrgrade.setValue(pageContext,emprgrade);
tibrgrade.setDisabled(true);

OAMessageTextInputBean  tibrcity = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempcity");
tibrcity.setValue(pageContext,emprcity);
tibrcity.setDisabled(true);

OAMessageTextInputBean  tibrdol = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rdol");
tibrdol.setValue(pageContext,emprdol);
tibrdol.setDisabled(true);
//---------------------

  if("2".equals(pageContext.getParameter("x"))){
  OAMessageTextInputBean  tibnewno1 = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("newrno");
  tibnewno1.setDisabled(true);
  OAMessageTextInputBean  tibhrcommet1 = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("hrcomments");
  tibhrcommet1.setDisabled(true);
  OAMessageCheckBoxBean  cbhrvacan1 = (OAMessageCheckBoxBean)webBean.findIndexedChildRecursive("vacancy");
  cbhrvacan1.setDisabled(true);
  OAMessageTextInputBean  tibhrjustify1 = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("justify");
   tibhrjustify1.setDisabled(true);
     }//end if 
}

  /**
   * Procedure to handle form submissions for form elements in
   * a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);

    if(pageContext.getParameter("SubmitComments")!=null){
   OAMessageTextInputBean  tibnewno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("newrno");
   String reqno=(String)tibnewno.getValue(pageContext);

   OAMessageTextInputBean  tibhrcommet = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("hrcomments");
   String hrcoment=(String)tibhrcommet.getValue(pageContext);


   OAMessageCheckBoxBean  cbhrvacan = (OAMessageCheckBoxBean)webBean.findIndexedChildRecursive("vacancy");
   String hrvacancy=(String)cbhrvacan.getValue(pageContext);
 

   OAMessageTextInputBean  tibhrjustify = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("justify");
   String hrjustify=(String)tibhrjustify.getValue(pageContext);
 
   System.out.println("Do the Updatation regarding EmpRequisitionNo.==="+reqno);
   OAApplicationModule am=pageContext.getApplicationModule(webBean);

try{
Connection conn =am.getOADBTransaction().getJdbcConnection();
Statement stmt = conn.createStatement();
int r=stmt.executeUpdate("update employeerequisitiondetail  set commentsByDepttNHR='"+hrcoment+"',Vacancy2bAnnounced='"+hrvacancy+"',justification='"+hrjustify+"' where employeerequistionno="+reqno+" ");
                                                           
System.out.println("I am in TOP ProcessFormRequest  Succesfully if result ====="+r);
am.getOADBTransaction().commit();
stmt.close();
}catch(Exception e){System.out.println(e.toString());}

HashMap params = new HashMap();
params.put("x","2");    
pageContext.setForwardURLToCurrentPage(params, true, OAWebBeanConstants.ADD_BREAD_CRUMB_NO,OAWebBeanConstants.IGNORE_MESSAGES);
    }


   }
 
   
  }
 

Tuesday 12 June 2012

passing two parameter in update query using OADBTransaction Class


 public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);

    if(pageContext.getParameter("SubmitComments")!=null){
   OAMessageTextInputBean  tibnewno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("newrno");
   String reqno=(String)tibnewno.getValue(pageContext);

   OAMessageTextInputBean  tibhrcommet = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("hrcomments");
   String hrcoment=(String)tibhrcommet.getValue(pageContext);
 
   System.out.println("Do the Updatation regarding EmpRequisitionNo.==="+reqno);
   OAApplicationModule am=pageContext.getApplicationModule(webBean);

try{
Connection conn =am.getOADBTransaction().getJdbcConnection();
Statement stmt = conn.createStatement();
int r=stmt.executeUpdate("update employeerequisitiondetail  set commentsByDepttNHR='"+hrcoment+"' where employeerequistionno="+reqno+" ");

                                                             
System.out.println("I am in TOP ProcessFormRequest  Succesfully if result ====="+r);
am.getOADBTransaction().commit();
stmt.close();
}catch(Exception e){System.out.println(e.toString());}
    }

How to get HashMap and request Parameter in the Next Page using pagecontext.getparameter method


public class HumanResourceController extends OAControllerImpl
{
  public static final String RCS_ID="$Header$";
  public static final boolean RCS_ID_RECORDED =
        VersionInfo.recordClassVersion(RCS_ID, "%packagename%");

  /**
   * Layout and page setup logic for a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processRequest(pageContext, webBean);
  System.out.println("I am Human Resource Page processRequest of HR page"); 
String eno=pageContext.getParameter("EmployeeNo");
String ena=pageContext.getParameter("EmployeeName");
String endgn=pageContext.getParameter("EmployeeDesignation");
String endv=pageContext.getParameter("EmployeeDivision");
String endp=pageContext.getParameter("EmployeeDepartment");
String encty=pageContext.getParameter("EmployeeCity");
//--------
String  empno =pageContext.getParameter("EmpNo");
String emppn=pageContext.getParameter("EmpPositionName");
String emplev=pageContext.getParameter("EmpLevel");
String  empgr =pageContext.getParameter("EmpGrade");
String empres=pageContext.getParameter("EmpResources");
String empdiv=pageContext.getParameter("EmpDivision");
String  empdeptt =pageContext.getParameter("EmpDepartment");
String empsubdeptt=pageContext.getParameter("EmpSubDepartment");
String empfun=pageContext.getParameter("EmpFunction");
String  empcty =pageContext.getParameter("EmpCity");
String emprpt=pageContext.getParameter("EmpReportTo");
String empst=pageContext.getParameter("EmpStatus");
String empct=pageContext.getParameter("EmpCaseType");
//---


String  emprno =pageContext.getParameter("EmpRno");
String emprname=pageContext.getParameter("EmpRname");
String emprdesignation=pageContext.getParameter("EmpRdesignation");
String  emprdepartment =pageContext.getParameter("EmpRdepartment");
String emprgrade=pageContext.getParameter("EmpRgrade");
String emprcity=pageContext.getParameter("EmpRcity");
String emprdol=pageContext.getParameter("EmpRdol");

//-




OAMessageTextInputBean  tibno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empno");
tibno.setValue(pageContext,eno);

OAMessageTextInputBean  tibname= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empname");
tibname.setValue(pageContext,ena);

OAMessageTextInputBean  tibdesignation = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empdesignation");
tibdesignation.setValue(pageContext,endgn);

OAMessageTextInputBean  tibdepartment = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empdepartment");
tibdepartment.setValue(pageContext,endv);

OAMessageTextInputBean  tibdivision= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empdivision");
tibdivision.setValue(pageContext,endp);

OAMessageTextInputBean  tibcity = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("empcity");
tibcity.setValue(pageContext,encty);

//------------------------------------------------------------



OAMessageTextInputBean  tibnewno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("newrno");
tibnewno.setValue(pageContext,empno);

OAMessageTextInputBean  tibpname= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("pname");
tibpname.setValue(pageContext,emppn);

OAMessageTextInputBean  tibelevel = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("elevel");
tibelevel.setValue(pageContext,emplev);

OAMessageTextInputBean  tibegrade = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("egrade");
tibegrade.setValue(pageContext,empgr);

OAMessageTextInputBean  tiberequired= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("erequired");
tiberequired.setValue(pageContext,empres);

OAMessageTextInputBean  tibedivision = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("edivision");
tibedivision.setValue(pageContext,empdiv);

OAMessageTextInputBean  tibedepartment = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("edepartment");
tibedepartment.setValue(pageContext,empdeptt);

OAMessageTextInputBean  tibesubdepartment= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("esubdepartment");
tibesubdepartment.setValue(pageContext,empsubdeptt);

OAMessageTextInputBean  tibefunction = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("efunction");
tibefunction.setValue(pageContext,empfun);

OAMessageTextInputBean  tibecity = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("ecity");
tibecity.setValue(pageContext,empcty);

OAMessageTextInputBean  tibereportto= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("ereporto");
tibereportto.setValue(pageContext,emprpt);

OAMessageTextInputBean  tibestatus = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("estatus");
tibestatus.setValue(pageContext,empst);

OAMessageTextInputBean  tibecasetype = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("ecasetype");
tibecasetype.setValue(pageContext,empct);
//------------------------------------------------------------




OAMessageTextInputBean  tibrno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempno");
tibrno.setValue(pageContext,emprno);

OAMessageTextInputBean  tibrname= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempname");
tibrname.setValue(pageContext,emprname);

OAMessageTextInputBean  tibrdesignation = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempdesignation");
tibrdesignation.setValue(pageContext,emprdesignation);

OAMessageTextInputBean  tibrdivision = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempdivision");
tibrdivision.setValue(pageContext,emprdepartment);

OAMessageTextInputBean  tibrgrade= (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempgrade");
tibrgrade.setValue(pageContext,emprgrade);

OAMessageTextInputBean  tibrcity = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rempcity");
tibrcity.setValue(pageContext,emprcity);

OAMessageTextInputBean  tibrdol = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("rdol");
tibrdol.setValue(pageContext,emprdol);

//---------------------


  }

  /**
   * Procedure to handle form submissions for form elements in
   * a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);
  }

}

how to Forward the Request Paramter to the next OAF Page using HashMap in the setForwardURL method


package oracle.apps.ak.EmployeeRequisitonProject.webui;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageCheckBoxBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageChoiceBean;
import oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.server.OADBTransaction;
import java.sql.*;
import java.io.Serializable;
import com.sun.java.util.collections.HashMap;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.jbo.domain.Number;


/**
 * Controller for ...
 */
public class InitiateEmpReqRNMainTopController extends OAControllerImpl
{
  public static final String RCS_ID="$Header$";
  public static final boolean RCS_ID_RECORDED =
        VersionInfo.recordClassVersion(RCS_ID, "%packagename%");

  /**
   * Layout and page setup logic for a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processRequest(pageContext, webBean);


// String existingEmpId=displayTextField.getText(pageContext);
 OAApplicationModule am=pageContext.getApplicationModule(webBean);
Serializable params[]={"1"};
am.invokeMethod("fetchExistingEmployee",params);

am.invokeMethod("getNewEmployeeData");

OAMessageTextInputBean  oatib = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("EmpRequisitionNo");
OADBTransaction trans=am.getOADBTransaction();
Number sqnum= trans.getSequenceValue("EMPREQUISITIONSEQUENCE");
String esn=sqnum.toString();
oatib.setText(pageContext,esn);
oatib.setDisabled(true);

Serializable params2[]={"4"};
am.invokeMethod("fetchReplacementEmployee",params2);



// get the handle of submitButton  and attach the javascirpt functin to it using setOnclick method of OASubmitButtonBean as shown below;
OASubmitButtonBean  sbButton = (OASubmitButtonBean)webBean.findIndexedChildRecursive("SubEmpReq");
//OAMessageCheckBoxBean  hrcb = (OAMessageCheckBoxBean)webBean.findIndexedChildRecursive("hrCheckBox");

sbButton.setOnClick("javascript:var psname=document.getElementById('EmpPositionName').value;"+
"var emplevel=document.getElementById('EmpLevel').value;"+
"var empgrade=document.getElementById('EmpGrade').value;"+
"var empresreq=document.getElementById('EmpResourcesRequired').value;"+
"var empdiv=document.getElementById('EmpDivision').value;"+
"var empsdp=document.getElementById('EmpSubDepartment').value;"+
"var empdp=document.getElementById('EmpDepartment').value;"+
"var empfun=document.getElementById('EmpFunction').value;"+
"var empcity=document.getElementById('EmpCity').value;"+
"var empreports=document.getElementById('EmpPositionReportsTo').value;"+
"if(psname==''||emplevel==''||empgrade==''||empresreq==''||empdiv==''||empsdp==''||empdp==''||empfun==''||empcity==''||empreports==''){  alert('Fill all Fields of  the Postion, Level, Grade, Resources Required, Division SubDiv,Function,city and ReportsTo before submitting the Form');"
+"document.getElementById('EmpPositionName').focus();return (false);}return (true);");




}












  /**
   * Procedure to handle form submissions for form elements in
   * a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
  super.processFormRequest(pageContext, webBean);

 OAApplicationModule am=pageContext.getApplicationModule(webBean);
     am.invokeMethod("handleUOMChangeEvent");
   
    if(pageContext.getParameter("SubEmpReq")!=null){
     System.out.println("Going to commit after if passed");
      am.invokeMethod("saveEmployeeRequisition");

HashMap parameters = new HashMap();

OAMessageTextInputBean  tibempno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("Employeeno");
String employeeno=(String)tibempno.getValue(pageContext);
System.out.println(employeeno);
parameters.put("EmployeeNo",employeeno);

OAMessageTextInputBean  tibempname = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("Employeename");
String employeename=(String)tibempname.getValue(pageContext);
System.out.println(employeename);
parameters.put("EmployeeName",employeename);



OAMessageTextInputBean  tibempdesign = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("Employeedesignation");
String employeedesign=(String)tibempdesign.getValue(pageContext);
System.out.println(employeedesign);
parameters.put("EmployeeDesignation",employeedesign);


OAMessageTextInputBean  tibempdivision = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("Employeedivision");
String employeedivision=(String)tibempdivision.getValue(pageContext);
System.out.println(employeedivision);
parameters.put("EmployeeDivision",employeedivision);



OAMessageTextInputBean  tibempdepartment = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("Employeedepartment");
String employeedepartment=(String)tibempdepartment.getValue(pageContext);
System.out.println(employeedepartment);
parameters.put("EmployeeDepartment",employeedepartment);


OAMessageTextInputBean  tibempcity = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("Employeecity");
String employeecity=(String)tibempcity.getValue(pageContext);
System.out.println(employeecity);
parameters.put("EmployeeCity",employeecity);
//-------------

OAMessageTextInputBean  tibno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("EmpRequisitionNo");
String empno=(String)tibno.getValue(pageContext);
System.out.println(empno);
parameters.put("EmpNo",empno);


OAMessageTextInputBean  tibposition = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("EmpPositionName");
String empposition=(String)tibposition.getValue(pageContext);
System.out.println(empposition);
parameters.put("EmpPositionName",empposition);



OAMessageTextInputBean  tiblevel = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("EmpLevel");
String emplevel=(String)tiblevel.getValue(pageContext);
System.out.println(emplevel);
parameters.put("EmpLevel",emplevel);


OAMessageTextInputBean  tibgrade = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("EmpGrade");
String empgrade=(String)tibgrade.getValue(pageContext);
System.out.println(empgrade);
parameters.put("EmpGrade",empgrade);

OAMessageTextInputBean  tibrr = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("EmpResourcesRequired");
String emprr=(String)tibrr.getValue(pageContext);
System.out.println(emprr);
parameters.put("EmpResources",emprr);


OAMessageTextInputBean  tibdivision = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("EmpDivision");
String empdivision=(String)tibdivision.getValue(pageContext);
System.out.println(empdivision);
parameters.put("EmpDivision",empdivision);


OAMessageTextInputBean  tibdepartment = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("EmpDepartment");
String empdepartment=(String)tibdepartment.getValue(pageContext);
System.out.println(empdepartment);
parameters.put("EmpDepartment",empdepartment);

OAMessageTextInputBean  tibsubdepartment = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("EmpSubDepartment");
String empsubdepartment=(String)tibsubdepartment.getValue(pageContext);
System.out.println(empsubdepartment);
parameters.put("EmpSubDepartment",empsubdepartment);


OAMessageTextInputBean  tibfunction = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("EmpFunction");
String empfunction=(String)tibfunction.getValue(pageContext);
System.out.println(empfunction);
parameters.put("EmpFunction",empfunction);

OAMessageTextInputBean  tibcity = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("EmpFunction");
String empcity=(String)tibcity.getValue(pageContext);
System.out.println(empcity);
parameters.put("EmpCity",empcity);

OAMessageTextInputBean  tibprt = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("EmpPositionReportsTo");
String empprt=(String)tibprt.getValue(pageContext);
System.out.println(empprt);
parameters.put("EmpReportTo",empprt);

OAMessageChoiceBean  mcstatus = (OAMessageChoiceBean)webBean.findIndexedChildRecursive("StatusMCL");
String empstatus=(String)mcstatus.getValue(pageContext);
System.out.println(empstatus);
parameters.put("EmpStatus",empstatus);

OAMessageChoiceBean  mccasetype = (OAMessageChoiceBean)webBean.findIndexedChildRecursive("CaseTypeMCL");
String empcasetype=(String)mccasetype.getValue(pageContext);
System.out.println(empcasetype);
parameters.put("EmpCaseType",empcasetype);

//-----------------

OAMessageTextInputBean  tibrempno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("Employeeno1");
String emprno=(String)tibrempno.getValue(pageContext);
System.out.println(emprno);
parameters.put("EmpRno",emprno);

OAMessageTextInputBean  tibrname = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("Employeereplacedname");
String emprname=(String)tibrname.getValue(pageContext);
System.out.println(emprname);
parameters.put("EmpRname",emprname);


OAMessageTextInputBean  tibrdesignation = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("Employeedesignation1");
String emprdesignation=(String)tibrdesignation.getValue(pageContext);
System.out.println(emprdesignation);
parameters.put("EmpRdesignation",emprdesignation);

OAMessageTextInputBean  tibrdepartment = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("Employeedepartment1");
String emprdepartment=(String)tibrdepartment.getValue(pageContext);
System.out.println(emprdepartment);
parameters.put("EmpRdepartment",emprdepartment);

OAMessageTextInputBean  tibrgrade = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("Employeegrade");
String emprgrade=(String)tibrgrade.getValue(pageContext);
System.out.println(emprgrade);
parameters.put("EmpRgrade",emprgrade);


OAMessageTextInputBean  tibrcity = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("Employeecity1");
String emprcity=(String)tibrcity.getValue(pageContext);
System.out.println(emprcity);
parameters.put("EmpRcity",emprcity);


OAMessageTextInputBean  tibrdol = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("Employeedateofleaving");
String emprdol=(String)tibrdol.getValue(pageContext);
System.out.println(emprdol);
parameters.put("EmpRdol",emprdol);

pageContext.setForwardURL("OA.jsp?page=/oracle/apps/ak/EmployeeRequisitonProject/HumanResourcePage",null,OAWebBeanConstants.KEEP_MENU_CONTEXT,null,parameters,true,OAWebBeanConstants.ADD_BREAD_CRUMB_YES,OAWebBeanConstants.IGNORE_MESSAGES);

 
  //OAApplicationModule am=pageContext.getApplicationModule(webBean);
  //OAMessageCheckBoxBean  hrcb = (OAMessageCheckBoxBean)webBean.findIndexedChildRecursive("hrCheckBox");
 // Object hrstate=hrcb.getValue(pageContext);        
 // String cbv=hrstate.toString();
  //Serializable params[]={cbv};
//  am.invokeMethod("handleCheckBoxChangeEvent",params);

    }
  
  

}

}  

Monday 4 June 2012

How to Directly insert or update values in DB using Connection and Statement classes using OADBTraction object in OAF Page


public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);
   
    if(pageContext.getParameter("Test")!=null){
    System.out.println(" I am  in if condition of Test Button");
OAApplicationModule am=pageContext.getApplicationModule(webBean);

try{
Connection conn =am.getOADBTransaction().getJdbcConnection();
Statement stmt = conn.createStatement();
int r=stmt.executeUpdate("update employeerequisitiondetail  set commentsByDepttNHR='Testing2' where employeerequistionno='41'");
System.out.println("I am in TOP ProcessFormRequest  Succesfully if result ====="+r);
am.getOADBTransaction().commit();
stmt.close();
}catch(Exception e){System.out.println(e.toString());}
    }

   }