Thursday 26 April 2012

AM Appliction Module Containing InsertMethod Called By Controller

package oracle.apps.ak.test.EOPackage;
import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
import oracle.jbo.Row;
import oracle.apps.fnd.framework.OAViewObject;
public class EOPackageModuleImpl extends OAApplicationModuleImpl
{
public void OurInsertMethod(String empid, String empname, String empdesign, String empdepart, String empdiv, String emploc ){
System.out.println("I am insert method in Am"+empid+empname);
 //get a handle to the View Object that we wish to initialize
    OAViewObject vo = (OAViewObject)getEmprequisitionView1();
    if(!vo.isPreparedForExecution()){
    vo.executeQuery();
    }
    //Create a blank Row
    Row row = vo.createRow();
    //Attach that blank row to the VO. Data will be fed into this row, when the user types into the fields
   //row.
     vo.insertRow(row);
    //Set the status of the blank row to initialized. This tells OA Framework that record is blank and must not be included in DML
    //Operations until    changes are made to its underlying VO [via screen fields]
   row.setNewRowState(Row.STATUS_INITIALIZED);
}
 public void saveDataToSimpleTable()
{        getDBTransaction().commit();}
  /**
   *
   * This is the default constructor (do not remove)
   */
  public EOPackageModuleImpl()
  {
  }

  /**
   *
   * Container's getter for EmprequisitionView1
   */
  public EmprequisitionViewImpl getEmprequisitionView1()
  {
    return (EmprequisitionViewImpl)findViewObject("EmprequisitionView1");
  }

  public static void main(String[] args)
  {
    launchTester("oracle.apps.ak.test.EOPackage", "EOPackageModuleLocal");
  }
}

No comments:

Post a Comment