Thursday 3 May 2012

Delete Method for OAF in AM Class

public Boolean deleteEmployee(String EmployeeId)
{
System.out.println("I am in deleteFunction");
// First, we need to find the selected EmployeeId in our VO.
// When we find it, we call remove( ) on the row which in turn
// calls remove on the associated PurchaseOrderHeaderEOImpl object.
//int poToDelete = .parseInt(EmployeeId);
OAViewObject vo = (OAViewObject)getEmprequisitionView1();
Row row[]=vo.getAllRowsInRange();
for(int i=0; i<row.length;i++){
EmprequisitionViewObjectRowImpl row1=(EmprequisitionViewObjectRowImpl) row[i];
System.out.println(row1.getEmpid());
  if(row1.getEmpid().toString().equals(EmployeeId)){
     row1.remove();
     getDBTransaction().commit();
     }
}

return new Boolean("true");
} // end

No comments:

Post a Comment