Wednesday, 3 July 2019

Find all Attributes of a OAF Page

 package oracle.apps.iby.fundcapture.setup.components.webui;
 import oracle.apps.fnd.framework.webui.OAPageContext;
 import oracle.apps.fnd.framework.OAApplicationModule;
 import java.util.Enumeration;
 import oracle.jdbc.OracleCallableStatement;
 import oracle.apps.fnd.framework.OAException;
 import oracle.apps.fnd.framework.server.OADBTransaction;

  public class xx_CreateExtBankAcctCO extends CreateExtBankAcctCO {
    public xx_CreateExtBankAcctCO() {
    }
public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
        super.processRequest(pageContext, webBean);
     }
     public void processFormRequest(OAPageContext pageContext,
                                   OAWebBean webBean)
{
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule oaapplicationmodule1 = pageContext.getApplicationModule(webBean);  
//  Main code Start from here
Enumeration enums = pageContext.getParameterNames();
            while(enums.hasMoreElements()){
               String paramName = enums.nextElement().toString();
               String s10 = "Param name: " +paramName+ "  <=>  Value: "+pageContext.getParameter(paramName);
   OADBTransaction txn = oaapplicationmodule1.getOADBTransaction();
               OracleCallableStatement  cs1 = (OracleCallableStatement)txn.createCallableStatement("begin xx_debug_proc(:1); end;",1);
               try
         {
                   cs1.setString(1, s10);
                   cs1.execute();
                   cs1.close();
                 }
               catch (Exception e1)
                 {
                   throw OAException.wrapperException(e1);
                 }
        // End here.
}
}
  }

Procedure XX_DEBUG_PROC:
   
     CREATE OR REPLACE PROCEDURE xx_debug_proc (p_msg VARCHAR2)
     IS
       PRAGMA AUTONOMOUS_TRANSACTION;
       BEGIN
          INSERT INTO xx_debug_tbl
  VALUES(FND_LOG_MESSAGES_S.nextval, p_msg);
  COMMIT;
       EXCEPTION
       WHEN OTHERS THEN
        ROLLBACK;
       END;

Table XX_DEBUG_TBL:
       CREATE TABLE xx_debug_tbl (SEQ_NUM NUMBER, DEBUG_MSG VARCHAR2(250));