Thursday, 28 July 2016

How to find the DFF column Names:

select distinct
fdfc.application_column_name attribute_no,
fdfc.end_user_column_name column1,
fdf.title,
fdfc.descriptive_flex_context_code dff_code,
fdf.application_table_name,
fdfc.display_flag Displayed,
fdfc.enabled_flag Enabled,
fdfc.required_flag Required1
from
apps.fnd_descriptive_flexs_vl fdf,
apps.fnd_descr_flex_col_usage_vl fdfc
where 1=1
and fdf.descriptive_flexfield_name=fdfc.descriptive_flexfield_name
and fdf.title like '%Vendor%Sites%'
---and fdf.descriptive_flexfield_name like '%PER_PEOPLE%'
and FDFC.DESCRIPTIVE_FLEX_CONTEXT_CODE='11565'
and FDFC.ENABLED_FLAG = 'Y'
---and fdfc.end_user_column_name like '%APPROVAL%STATUS%'
---order by FDFC.LAST_UPDATE_DATE desc

Thursday, 25 February 2016

How to get multiple rows of selected :

public void getMultipleRowsSelected(){

testVOImpl billvo=(testVOImpl)gettestVO1();

String lnstrref=null;
ArrayList errorMsg= new ArrayList();
 Row billRows[] = billvo.getFilteredRows("selected", "Y");
 if(billRows.length >0){
  for (int b = 0; b < billRows.length; b++) {
                    testVORowImpl brow = (testVORowImpl)billRows[b];
                                     if(brow.getStatusFlag().equalsIgnoreCase("D")){
                                     
                                      }else{
OAException errmessage =new OAException(" please check the status of "+brow.getsomeId(),OAException.ERROR);
                                      errorMsg.add(errmessage);
                                      }
                                     }
}

                if(errorMsg.size()>0){
OAException.raiseBundledOAException(errorMsg);

                }              
 }

Friday, 5 February 2016

ackage xxpfc.oracle.apps.per.selfservice.personalinformation.webui;


import java.util.Date;

import oracle.apps.fnd.framework.OAApplicationModule;
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.OAWebBeanConstants;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBean;
import oracle.apps.fnd.framework.webui.beans.layout.OAStackLayoutBean;
import oracle.apps.per.selfservice.personalinformation.webui.PerinfoNavigationBarCO;

import oracle.cabo.ui.action.FireAction;
import oracle.cabo.ui.action.FirePartialAction;

import oracle.jbo.Row;
import oracle.jbo.ViewObject;


public class PFCPerinfoNavigationBarCO extends PerinfoNavigationBarCO
{
  public PFCPerinfoNavigationBarCO()
  {
  }
  
  public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
      {
          super.processRequest(oapagecontext, oawebbean);
          OAApplicationModule rootAM=(OAApplicationModule)oapagecontext.getRootApplicationModule();
          String rootam= rootAM.getDefFullName();
          oapagecontext.writeDiagnostics(this,"value oa am is :"+rootam,4);
          OAApplicationModule contactsMainAM=(OAApplicationModule)rootAM.findApplicationModule("ContactsMainAM");
          if(contactsMainAM!=null)
          { 
            String contactAM=contactsMainAM.getDefFullName();      
            oapagecontext.writeDiagnostics(this,"value oa am is :"+contactAM,4);
          }
          OAStackLayoutBean slb=(OAStackLayoutBean)oawebbean.findChildRecursive("BasicDetailsUpdateForm");
          if(slb !=null)
          {
          String slbName=slb.getDataObjectName();
          oapagecontext.writeDiagnostics(this,"value oa am is :"+slb,4);
          oapagecontext.writeDiagnostics(this,"value oa am is :"+slbName,4);
          }
          OAApplicationModule contactNameAM=(OAApplicationModule)oapagecontext.getApplicationModule(slb);
          if(contactNameAM!=null)
          {
           String contact1AM=contactNameAM.getDefFullName();
           oapagecontext.writeDiagnostics(this,"value oa am is :"+contact1AM,4);
          }

      }
          
//          oapagecontext.writeDiagnostics(this,"value oa am is :"+ams,4);
//          OASubmitButtonBean oasubmitbuttonbean1 = (OASubmitButtonBean)oawebbean.findIndexedChildRecursive("HrnextButton");   
//          FireAction firePartialAction = new FirePartialAction("HrnextButton");
//          oasubmitbuttonbean1.setAttributeValue(PRIMARY_CLIENT_ACTION_ATTR,firePartialAction);
      }
//  public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
//      {
//         if(oapagecontext.getParameter("HrnextButton")!=null)
//         {
//          OAApplicationModule rootAM=(OAApplicationModule)oapagecontext.getRootApplicationModule();
//          String rootam= rootAM.getDefFullName();
//          oapagecontext.writeDiagnostics(this,"value from query"+rootam,4);
//          super.processFormRequest(oapagecontext, oawebbean);
////          OAStackLayoutBean slb=(OAStackLayoutBean)oawebbean.findChildRecursive("BasicDetailsUpdateForm");       
//          OAApplicationModule ContactsMainAM=(OAApplicationModule)oapagecontext.getApplicationModule(oawebbean);
//           
//         
////          OAViewObject ContactsMainVO=(OAViewObject)ContactsMainAM.findViewObject("ContactsMainVO");
////          Row birthDayDateRow =ContactsMainVO.getCurrentRow();
//
////          String  birthDate= birthDayDateRow.getAttribute("DateOfBirth").toString();
//
////          oapagecontext.writeDiagnostics(this,"value birthDate"+birthDate,4);
////          Date BirthDayDate=oapagecontext.getOANLSServices().stringToDate("birthDate");
////          oapagecontext.writeDiagnostics(this,"value BirthDayDate"+BirthDayDate,4);
////          String  kin=birthDayDateRow.getAttribute("ContInformation1").toString();
////          oapagecontext.writeDiagnostics(this,"value kin:"+kin,4);
////         
////         
////          if(kin.equalsIgnoreCase("yes")&&("HrnextButton".equals(oapagecontext.getParameter(OAWebBeanConstants.EVENT_PARAM))))
////           {
////             
////            String Query= "SELECT trunc(sysdate) - to_date(:1)\n" + 
////            "  FROM dual";
////            ViewObject QueryVO = (ViewObject)rootAM.createViewObjectFromQueryStmt("QueryVO",Query);
////            QueryVO.setWhereClauseParam(0,BirthDayDate);
////            Row QueryRow = QueryVO.first();
////            String QueryValue =(String)(QueryRow.getAttribute(0));
////            QueryVO.remove();
////            oapagecontext.writeDiagnostics(this,"value from query"+QueryValue,4);
////            int DateOfBirth=Integer.parseInt("QueryValue");
////            
////            //days in 18 years is 6574
////            if(DateOfBirth <6574)
////            {
////             throw new OAException("For Next Of Kin The Age Should Be Must Greater Then 18Yrs",OAException.ERROR);
////            }
////            
////            
////            
////          }
//      }
//
//}

Thursday, 21 January 2016

Updating DFF in PFR:



 package xxigfmis.oracle.apps.irc.vacancy.webui;

 import java.io.Serializable;

 import java.sql.CallableStatement;

import java.sql.SQLException;
import java.sql.Types;

 import oracle.jdbc.OracleCallableStatement;
 import java.util.Enumeration;
 import java.util.Hashtable;
 import oracle.apps.fnd.common.VersionInfo;
 import oracle.apps.fnd.framework.OAApplicationModule;
 import oracle.apps.fnd.framework.server.OADBTransaction;
 import oracle.apps.fnd.framework.webui.OAPageContext;
 import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
 import oracle.apps.fnd.framework.webui.beans.OADescriptiveFlexBean;
 import oracle.apps.fnd.framework.webui.beans.OAWebBean;
 import oracle.apps.fnd.framework.webui.beans.message.OAMessageChoiceBean;
 import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
 import oracle.apps.irc.vacancy.server.IrcEditVacancyVOImpl;
 import oracle.apps.irc.vacancy.server.VacancyAMImpl;
 import oracle.jbo.Row;
 import oracle.apps.irc.vacancy.webui.VacNewDetsPageCO;

 // Referenced classes of package oracle.apps.irc.vacancy.webui:
 //            VacancyCO

 public class xxVacNewDetsPageCO extends VacNewDetsPageCO
 {

     public xxVacNewDetsPageCO()
     {
     }

   

     public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
     {
           
       
         super.processFormRequest(oapagecontext, oawebbean);
               
                  VacancyAMImpl vacancyamimpl = (VacancyAMImpl)oapagecontext.getRootApplicationModule();
         IrcEditVacancyVOImpl cvo = vacancyamimpl.getIrcEditVacancyVO();
     String outParamValue1 = null;
     String outParamValue2 = null;
     String outParamValue3 = null;
          String outParamValue4 = null;
          String outParamValue5 = null;
          String outParamValue6 = null;
          String outParamValue7 = null;
          String outParamValue8 = null;
          String outParamValue9 = null;
          String outParamValue10 = null;
          String outParamValue11= null;    
   
                 Row row=cvo.first();
                 if(row !=null){
               
               
                 }else{
               
                 row=cvo.getCurrentRow();
               
                 }
                 //row.setAttribute("Attribute1", "1");
                 //row.setAttribute("Attribute2", "2");
                 //row.setAttribute("Attribute3", "3");
                 //row.setAttribute("Attribute4", "4");
                 oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",row.getAttribute("BudgetMeasurementValue")+"Raju",2);  
   

   
     oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",oapagecontext.getLovInputSourceId()+"Raju",2);  
     if("FndLocation".equals(oapagecontext.getLovInputSourceId())){
       
      OADBTransaction txn = vacancyamimpl.getOADBTransaction();
 
      CallableStatement callableStatement =
 
        txn.createCallableStatement("begin xxigfmis_irec_pkg.xxigfmis_vac_reservation(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12); end;",OADBTransaction.DEFAULT);
 
      try {
 
        callableStatement.registerOutParameter(2, Types.VARCHAR);
 callableStatement.registerOutParameter(3, Types.VARCHAR);
 callableStatement.registerOutParameter(4, Types.VARCHAR);
 callableStatement.registerOutParameter(5, Types.VARCHAR);
 callableStatement.registerOutParameter(6, Types.VARCHAR);
 callableStatement.registerOutParameter(7, Types.VARCHAR);
 callableStatement.registerOutParameter(8, Types.VARCHAR);
 callableStatement.registerOutParameter(9, Types.VARCHAR);
 callableStatement.registerOutParameter(10, Types.VARCHAR);
 callableStatement.registerOutParameter(11, Types.VARCHAR);    
 callableStatement.registerOutParameter(12, Types.VARCHAR);  
 
        callableStatement.setString(1, row.getAttribute("BudgetMeasurementValue").toString());
 
     
         
 
        callableStatement.execute();
 
        outParamValue1 = callableStatement.getString(2);
 outParamValue2 = callableStatement.getString(3);
 outParamValue3 = callableStatement.getString(4);
 outParamValue4 = callableStatement.getString(5);
 outParamValue5 = callableStatement.getString(6);
 outParamValue6 = callableStatement.getString(7);
 outParamValue7 = callableStatement.getString(8);
 outParamValue8 = callableStatement.getString(9);
 outParamValue9 = callableStatement.getString(10);
 outParamValue10 = callableStatement.getString(11);
 outParamValue11 = callableStatement.getString(12);

          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue1+"raju",2);
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue2+"raju",2);
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue3+"raju",2);
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue4+"raju",2);
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue5+"raju",2);
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue6+"raju",2);
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue7+"raju",2);
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue8+"raju",2);
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue9+"raju",2);
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue10+"raju",2);
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue11+"raju",2);
        callableStatement.close();
 
      } catch (SQLException sqle) {
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",sqle.getMessage()+"raju",2);
        //callableStatement.close();
 
      }
     OADescriptiveFlexBean oaDFF = (OADescriptiveFlexBean)oawebbean.findChildRecursive("FndFlexField"); // put your dff web bean name here
   
     OAMessageTextInputBean msg0=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField0");
     msg0.setText(outParamValue1);
     OAMessageTextInputBean msg1=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField1");
     msg1.setText(outParamValue2);
     OAMessageTextInputBean msg2=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField2");
     msg2.setText(outParamValue3);
     OAMessageTextInputBean msg3=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField3");
     msg3.setText(outParamValue4);
     OAMessageTextInputBean msg4=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField4");
     msg4.setText(outParamValue5);
     OAMessageTextInputBean msg5=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField5");
     msg5.setText(outParamValue6);
     OAMessageTextInputBean msg6=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField6");
     msg6.setText(outParamValue7);
     OAMessageTextInputBean msg7=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField7");
     msg7.setText(outParamValue8);
     OAMessageTextInputBean msg8=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField8");
     msg8.setText(outParamValue9);
     OAMessageTextInputBean msg9=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField9");
     msg9.setText(outParamValue10);
     OAMessageTextInputBean msg10=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField10");
     msg10.setText(outParamValue11);
 }//end lov event


 }

 }
    OADescriptiveFlexBean oaDFF =(OADescriptiveFlexBean)dffCol.findIndexedChildRecursive("SiteUseDFF");
         
    {
 
    oaDFF.processFlex(pagecontext);

    OAWebBean dffbeans0 = (OAWebBean)oaDFF.findChildRecursive("SiteUseDFF0");

      if (dffbeans0 != null)
      {

      dffbeans0.setAttributeValue(OAWebBeanConstants.READ_ONLY_SET, true);
        dffbeans0.setAttributeValue(OAWebBeanConstants.READ_ONLY_ATTR, true);
      }


      OAWebBean dffbeans1 = (OAWebBean)oaDFF.findChildRecursive("SiteUseDFF1");

      if (dffbeans1 != null)
      {

        dffbeans1.setAttributeValue(OAWebBeanConstants.READ_ONLY_SET, true);
        dffbeans1.setAttributeValue(OAWebBeanConstants.READ_ONLY_ATTR, true);
      }
}


https://community.oracle.com/thread/2263077?tstart=0 


package xxclt.oracle.apps.irc.vacancy.webui;

import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.webui.OAWebBeanUtils;
import oracle.apps.fnd.framework.webui.beans.OADescriptiveFlexBean;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageCheckBoxBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageChoiceBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageLovChoiceBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageLovInputBean;
import oracle.apps.irc.vacancy.webui.VacNewDetsPageCO;
import oracle.cabo.ui.action.FireAction;
import oracle.jbo.ViewObject;


public class XXVacNewDetsPageCO extends VacNewDetsPageCO {
public XXVacNewDetsPageCO() {
}

public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
super.processRequest(pageContext, webBean);
OADescriptiveFlexBean dffBean =
(OADescriptiveFlexBean)webBean.findIndexedChildRecursive("FndFlexField");
dffBean.processFlex(pageContext);
OAMessageChoiceBean segment1 =
(OAMessageChoiceBean)dffBean.findChildRecursive("FndFlexField0");
segment1.setRequired("yes");
segment1.setFireActionForSubmit ("selectBCN",null, null,true, true);

}

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

if ("selectBCN".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM))) {
// The Position poplist PPR change event has fired.
OAApplicationModule am = pageContext.getRootApplicationModule();
String vStatus;
OADescriptiveFlexBean dffBean =
(OADescriptiveFlexBean)webBean.findIndexedChildRecursive("FndFlexField");
dffBean.processFlex(pageContext);
OAMessageChoiceBean bcnSegment =
(OAMessageChoiceBean)dffBean.findChildRecursive("FndFlexField0");
String vBCNValue = bcnSegment.getSelectionValue(pageContext) ;
pageContext.writeDiagnostics("XXCLIENT",vBCNValue,1);
String vacancyInfoQuery =
"SELECT bcn, grade, job_title, vacancy_type, ORGANIZATION FROM xxclt_mbd_bcn_info_v";

//Specify the Where Clause for the same
vacancyInfoQuery = vacancyInfoQuery + " WHERE bcn = :1 ";

//First see if this VO is already attached to view object
ViewObject vacancyInfoVO = am.findViewObject("XXVvacancyInfoVO");
if (vacancyInfoVO == null)
vacancyInfoVO =
am.createViewObjectFromQueryStmt("XXVvacancyInfoVO",
vacancyInfoQuery);
//By now we are sure that the view object exists
vacancyInfoVO.setWhereClauseParams(null);
//Set the where clause
vacancyInfoVO.setWhereClauseParam(0, vBCNValue);
vacancyInfoVO.executeQuery();
oracle.jbo.Row row = vacancyInfoVO.first();
//get the value of description column from View Object record returned
String vGrade = "";
String vJobTitle = "";
String vVacancyType = "";
String vOrganization = "";

if (row != null) {
vGrade = row.getAttribute(1).toString();
vJobTitle = row.getAttribute(2).toString();
vVacancyType = row.getAttribute(3).toString();
vOrganization = row.getAttribute(4).toString();
}

OAMessageLovInputBean vGradeBean =
(OAMessageLovInputBean)webBean.findChildRecursive("FndGrade");
OAMessageLovInputBean vJobTitleBean =
(OAMessageLovInputBean)webBean.findChildRecursive("FndJobTitle");
OAMessageChoiceBean vVacancyTypeBean =
(OAMessageChoiceBean)dffBean.findChildRecursive("FndFlexField1");
OAMessageLovInputBean vOrgBean =
(OAMessageLovInputBean)webBean.findChildRecursive("FndOrganization");

vVacancyTypeBean.setSelectedValue(vVacancyType);
vGradeBean.setText( vGrade);
vJobTitleBean.setText(vJobTitle);
vOrgBean.setText(vOrganization);
// vOrgBean.set
OAMessageCheckBoxBean vEmpChkBox;
OAMessageCheckBoxBean vCntrChkBox;
vEmpChkBox =
(OAMessageCheckBoxBean)webBean.findChildRecursive("FndEmployee");
vCntrChkBox =
(OAMessageCheckBoxBean)webBean.findChildRecursive("FndContractor");

if (vVacancyType.equals("PMR") ) {
vEmpChkBox.setChecked(true);
vCntrChkBox.setChecked(false);
}else if(vVacancyType.equals("TMR") ) {
vCntrChkBox.setChecked(true);
vEmpChkBox.setChecked(false);
}
//Remove the view object, as this is no longer required
vacancyInfoVO.remove();
}
}

}



Thursday, 14 January 2016

package xxx.oracle.apps.ota.lov.webui;

import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.ota.lov.webui.ResBookingNamesLovCO;
import oracle.apps.ota.lov.server.LovAMImpl;
import oracle.apps.ota.lov.server.ResBookingNamesVOImpl;

public class xxResBookingNamesLovCO extends ResBookingNamesLovCO {
    public xxResBookingNamesLovCO() {
    }
   
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
   {
     
      String ClassStartTime1 = null;
      if(pageContext.getParameter("ClassStartTime1")!=null){
         ClassStartTime1= pageContext.getParameter("ClassStartTime1").toString();
          pageContext.writeDiagnostics("BANDAM"+ClassStartTime1,"xxResBookingNamesLovCO",2);
      }
               
      pageContext.writeDiagnostics("BANDAM is null "+ClassStartTime1,"xxResBookingNamesLovCO",2);              
      String ClassEndDate1 = null;
      if(pageContext.getParameter("ClassEndDate1")!=null){
         ClassEndDate1= pageContext.getParameter("ClassEndDate1").toString();
          pageContext.writeDiagnostics("BANDAM"+ClassEndDate1,"xxResBookingNamesLovCO",2);
      }
     
      pageContext.writeDiagnostics("BANDAM is null "+ClassEndDate1,"xxResBookingNamesLovCO",2);
      if(ClassEndDate1!=null && ClassStartTime1 !=null){
     
     
     
      LovAMImpl localLovAMImpl = (LovAMImpl)pageContext.getApplicationModule(webBean);
      ResBookingNamesVOImpl resvo=(ResBookingNamesVOImpl)localLovAMImpl.getResBookingNamesVO1();
      if(resvo !=null){
     
                   String condSql =null;      
                               
                                       try{
                                   condSql="";
                               resvo.setFullSqlMode(resvo.FULLSQL_MODE_AUGMENTATION);
         
                               resvo.setQuery(condSql);
                           }
                           catch(Exception e){
                         
                           }
     
      }
     
      }
     
  }
}