Monday, December 31, 2018

Oracle OAF :- Deploying New Page



Page Compile
===================

java oracle.jrad.tools.xml.importer.XMLImporter $JAVA_TOP/oracle/apps/fnd/framework/navigate/webui/NewHomePG.xml /* Page Path */
-username apps  /* User Name */
-password testapps   /* Password */
-rootdir $JAVA_TOP
-dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(
HOST=192.11.101.11 /*Host*/
)(
PORT=1001 /*Port*/
))(CONNECT_DATA=(
SID=TESTINSTANCE /*SID*/
)))"


Check the Page is Deployed
=============================

DECLARE
BEGIN
   jdr_utils.printdocument (
      '/oracle/apps/fnd/framework/navigate/webui/NewHomePG',
      1000);
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line (SQLERRM);
END;



Oracle OAF: Get & Set Session Values

Put Session Value 
=========================

 pageContext.putSessionValue("mode", "U");

Get Session Value 
=========================

String mode = (String)pageContext.getSessionValue("mode");

 if (mode.equals("C"))

Oracle OAF : Code Combination Dynamic

Controller
===================

OAApplicationModule am = pageContext.getApplicationModule(webBean);
System.out.println("Before Setting the Flex Field ");
String str12 = (String)am.invokeMethod("getFSC", new Serializable[] { String.valueOf(pageContext.getOrgId()) });
OAKeyFlexBean kffId = (OAKeyFlexBean)webBean.findIndexedChildRecursive("WriteoffCodeCombination");
kffId.useCodeCombinationLOV(true);
kffId.setStructureCode(str12);
kffId.setCCIDAttributeName("WriteoffCodeCombinationId");
// kffId.setRequired("yes");
// kffId.setWidth("170%");
kffId.addVRule("", "SUMMARY_FLAG", new Message("SQLGL", "GL_NO_PARENT_SEGMENT_ALLOWED"), true, new String[] { "N" });


Ampplication Module
====================

public String getFSC(String paramString)
{
String str1 = null;
String str2 = "begin select kst.id_flex_structure_code  into :1  from apps.fnd_id_flex_structures kst, apps.gl_ledgers gll,  apps.hr_operating_units hro  where     kst.id_flex_code = 'GL#' and kst.application_id = 101 and kst.id_flex_num = gll.chart_of_accounts_id   and gll.ledger_id = hro.set_of_books_id   and hro.organization_id = :2 ; end;";
CallableStatement localOracleCallableStatement = getOADBTransaction().createCallableStatement(str2, 1);
try
{
int i = Integer.parseInt(paramString);
localOracleCallableStatement.setInt(2, i);
localOracleCallableStatement.registerOutParameter(1, 12);
localOracleCallableStatement.execute();
str1 = localOracleCallableStatement.getString(1);
}
catch (SQLException e)  {throw new OAException("Sequence not found");}
if ((str1 == null) || ("".equals(str1.trim()))) str1 = "OPERATIONS_ACCOUNTING_FLEX";
return str1;
 }

OAF AddRow : Create New Row In Line Table

Controller
========================================

if ("AddRow".equals(pageContext.getParameter("event"))) { am.invokeMethod("AddRow");}
 

Application Module
========================================

public void AddRow()
{
OAViewObject voLine = (OAViewObject)getWrOffLineVO1();
OAViewObject voHeader = (OAViewObject)getWrOffHeaderVO1();
if (!voLine.isPreparedForExecution()) { voLine.setMaxFetchSize(0); voLine.executeQuery(); }
voLine.last(); voLine.next();
Row row = voLine.createRow(); voLine.insertRow(row);
row.setNewRowState((byte)-1);
String HReqID = voHeader.getCurrentRow().getAttribute("InvWriteoffHeaderId").toString();
row.setAttribute("LineNo", Integer.valueOf(voLine.getRowCount()));
row.setAttribute("InvWriteoffHeaderId", HReqID);
}

Sunday, December 30, 2018

Oracle OAF : Calling PLSQL Procedure From OAF

Controller
========================================

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);
          OAApplicationModule am = pageContext.getApplicationModule(webBean);
          if (pageContext.getParameter("item3") != null)       
           {         
                Serializable[] ParamAddValues = { pageContext.getParameter("item1"),
   pageContext.getParameter("item2")};
                             
            String retSumValue = (String)am.invokeMethod("AddNumber", ParamAddValues);
            String message = "Sum:  " + retSumValue;                   
            throw new OAException(message, OAException.INFORMATION);
            }
  }
 

Application Module
========================================

import java.sql.CallableStatement;
import java.sql.SQLException;
import oracle.apps.fnd.framework.OAException; 
 
public String AddNumber(String item1,String item2)
    {
    OADBTransaction oadbtransaction = (OADBTransaction)getTransaction();
        OADBTransactionImpl oadbtransactionimpl = (OADBTransactionImpl)getTransaction();
        String retValues;
        StringBuffer str = "Begin proc_in_oaf.addition(:1,:2,:3); End;";   
        OracleCallableStatement oraclecallablestatement =
(OracleCallableStatement)oadbtransaction.createCallableStatement(str.toString(), 1);
try{
oraclecallablestatement.setFloat(1,  Float.parseFloat(item1)  );
oraclecallablestatement.setFloat(2,  Float.parseFloat(item2) );
oraclecallablestatement.registerOutParameter(3, Types.VARCHAR);
oraclecallablestatement.execute();                     
retValues = oraclecallablestatement.getString(3);
}
catch(Exception e) {throw OAException.wrapperException(e);}
     return retValues;
    }

Wednesday, December 26, 2018

Oracle OAF : Deleting Row

// Deleting Direclty In Controller

// Controller CODE
/////////////////////Delete Load Table/////////////////////////////////////////
if ("delete".equals(pageContext.getParameter("event")))
{
   String rowReference = pageContext.getParameter(EVENT_SOURCE_ROW_REFERENCE);
   System.out.println(rowRef);
   ARow currRow = (OARow)am.findRowByRef(rowReference);
   currRow.remove();
}

/********************************************************************************/
// Deleting In AM

// Controller CODE
/////////////////////Delete Load Table/////////////////////////////////////////
if ("DelCommRows".equals(pageContext.getParameter(EVENT_PARAM)))
    {
        String rowRef = pageContext.getParameter(EVENT_SOURCE_ROW_REFERENCE);
        System.out.println(rowRef);
        Serializable [] param={rowRef};
        am.invokeMethod("deleteRec",param);
    }


// AM CODE
/////////////////////Delete Load Table/////////////////////////////////////////
 public void deleteRec(String  ref)
 {
   Row r = findRowByRef(ref);
   r.remove();
   getTransaction().commit();
 }

Oracle OAF : Dynamic Image URL

/* Add in Image Url 
CustomFolderName :- This folder should be inside the OA_Media
ImageName := ViewAttribute with the Image Name from Database
*/
/OA_MEDIA/CustomFolderName /{@EmpNo}.jpg



Adding Image & Data In Same Field


Process Request 
=========================

Object localObject3 = (OAImageBean)localOATableBean.findIndexedChildRecursive("StatusImage");
Object localObject5 = new OADataBoundValueViewObject((OAWebBean)localObject3, "StatusImage");
Object localObject4 = new FixedBoundValue("/OA_MEDIA/");
ConcatBoundValue localConcatBoundValue = new ConcatBoundValue(new BoundValue[] { localObject4, localObject5 });
((OAImageBean)localObject3).setAttributeValue(SOURCE_ATTR, localConcatBoundValue);
((OAImageBean)localObject3).setAttributeValue(SHORT_DESC_ATTR, "Purchase order status indicator");



Status Item Type :- FlowLayout




Oracle OAF : Number Formatting

import oracle.cabo.ui.validate.Formatter;


        Formatter  formatter = new OADecimalValidater("#,##0.00","#,##0.00");
        OAMessageStyledTextBean originalamtBean = (OAMessageStyledTextBean)webBean.findChildRecursive("Amount");
           if(originalamtBean != null)
                               {  originalamtBean.setAttributeValue(ON_SUBMIT_VALIDATER_ATTR, formatter);
                                         CSSStyle csNum = new CSSStyle();                 
                         csNum.setProperty("text-align","right");
                         csNum.setProperty("display","block");
                         originalamtBean .setInlineStyle(csNum);
                                         }

Oracle OAF : get OrgId UserName ResponsibilityId UserId

If in Process Form Request
===================================

String userid = String.valueOf(pageContext.getUserId());
String username = pageContext.getUserName();
String respid = String.valueOf(pageContext.getResponsibilityId());
String respname =  pageContext.getResponsibilityName();
String OrganizationId = pageContext.getSessionValue("OrganizationId").toString();
Date currdate=pageContext.getCurrentDBDate();
String rowRef = pageContext.getParameter(EVENT_SOURCE_ROW_REFERENCE);

If Adding in AM
===================================

      OAApplicationModule am = pageContext.getApplicationModule(webBean);
      OAViewObject vo=(OAViewObject)am.findViewObject("CpxReqHVO1");
      OARow row=(OARow)vo.getCurrentRow();
      row.setAttribute("OrgId",pageContext.getProfile("ORG_ID") );

In VO
===================================

   AND ac.org_id = fnd_global.org_id


Following are the FND_PROFILE values that can be used in the PL/SQL code:

   fnd_profile.value('PROFILEOPTION');
   fnd_profile.value('MFG_ORGANIZATION_ID');
   fnd_profile.value('ORG_ID');
   fnd_profile.value('LOGIN_ID');
   fnd_profile.value('USER_ID');
   fnd_profile.value('USERNAME');
   fnd_profile.value('CONCURRENT_REQUEST_ID');
   fnd_profile.value('GL_SET_OF_BKS_ID');
   fnd_profile.value('SO_ORGANIZATION_ID');
   fnd_profile.value('APPL_SHRT_NAME');
   fnd_profile.value('RESP_NAME');
   fnd_profile.value('RESP_ID');

Following are the FND_GLOBAL values that can be used in the PL/SQL code:

   FND_GLOBAL.USER_ID;
   FND_GLOBAL.APPS_INTIALIZE;
   FND_GLOBAL.LOGIN_ID;
   FND_GLOBAL.CONC_LOGIN_ID;
   FND_GLOBAL.PROG_APPL_ID;
   FND_GLOBAL.CONC_PROGRAM_ID;
   FND_GLOBAL.CONC_REQUEST_ID;

For example, I almost always use the following global variable assignments in my package specification to use throughout the entire package body:

   g_user_id      PLS_INTEGER  :=  fnd_global.user_id;
   g_login_id     PLS_INTEGER  :=  fnd_global.login_id;
   g_conc_req_id  PLS_INTEGER  :=  fnd_global.conc_request_id;
   g_org_id       PLS_INTEGER  :=  fnd_profile.value('ORG_ID');
   g_sob_id       PLS_INTEGER  :=  fnd_profile.value('GL_SET_OF_BKS_ID');

And initialize the application environment as follows:

   v_resp_appl_id  := fnd_global.resp_appl_id;
   v_resp_id       := fnd_global.resp_id;
   v_user_id       := fnd_global.user_id;
   


 FND_GLOBAL.APPS_INITIALIZE(v_user_id,v_resp_id, v_resp_appl_id);

Reference :- https://docs.oracle.com/cd/E18727_01/doc.121/e12897/T302934T462356.htm

VariableDescription
USER_IDThe USER_ID number
RESP_IDThe ID number of the responsibility
RESP_APPL_IDThe ID number of the application to which the responsibility belongs

   

Oracle OAF : Get Current Row in Table (Oracle Application Framework or OA Framework)


public void processFormRequest(OAPageContext pageContext, 

OAWebBean webBean) {
super.processFormRequest(pageContext, webBean);
//Get application Module
OAApplicationModule am = 
            pageContext.getApplicationModule(webBean);
        
//Get Row Refrence
String rowReference =  
            pageContext.getParameter(EVENT_SOURCE_ROW_REFERENCE);
            
//Get current Row using Row Reference    
OARow currRow = (OARow)am.findRowByRef(rowReference);
        
//Get attribute value from current row
String attrValue = (String)currRow.getAttribute("AttrName");
        
//Setting The attribute value from current row
row.setAttribute("transfielddisable", Boolean.TRUE);
}
// Issue Faced ---- 
//Number WfQty = (Number)currRow.getAttribute("WriteoffQuanity");
// if ( WfQty.intValue() <= AvailQty.intValue())

Oracle OAF : Create XML Report (Oracle Application Framework or OA Framework)

Controller
=============================================


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.OAApplicationModule;
import oracle.apps.fnd.framework.OAViewObject;
import java.io.Serializable;
import oracle.apps.fnd.framework.webui.OADecimalValidater;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
import oracle.cabo.ui.validate.Formatter;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.webui.beans.OARawTextBean;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import oracle.apps.fnd.framework.server.OADBTransactionImpl;
import oracle.apps.xdo.XDOException;
import oracle.apps.xdo.oa.schema.server.TemplateHelper;
import oracle.apps.xxbg.bgcpxreq.server.CpxReqAMImpl;
import oracle.cabo.ui.data.DataObject;
import oracle.xml.parser.v2.XMLNode;


/*
if (pageContext.getParameter("PrintReport") != null)
      {
          OAApplicationModule am = pageContext.getApplicationModule(webBean);
  String REQNO = pageContext.getParameter("ParamHeaderID");
  System.out.println("Req no is :" + REQNO);
          Serializable[] params = { REQNO };
          am.invokeMethod("initGenerateXMLData", params);
      }  */

       if (pageContext.getParameter("PrintReport") != null) {
           System.out.println (" Vishal Generate Report Is Clicked");
       
               
                 String ls_extensionType = "pdf"; //Setting the output extension type
                 byte l_outputType = 0;
                 l_outputType = TemplateHelper.OUTPUT_TYPE_PDF;


                 DataObject lo_sessionDictionary =  pageContext.getNamedDataObject("_SessionParameters");
                 HttpServletResponse lo_response = (HttpServletResponse)lo_sessionDictionary.selectValue(null, "HttpServletResponse");
                       
                try {
                     ServletOutputStream lo_outputStream =  lo_response.getOutputStream();
                     // setting the report name &amp; output type
                     String lo_contentDisposition =  "attachment;filename=OrderDetails." + ls_extensionType;
                     lo_response.setHeader("Content-Disposition", lo_contentDisposition);
                     lo_response.setContentType("application/pdf");

                     System.out.println("Vishal Calling XML generation method");
                   
                     String REQNO = pageContext.getParameter("ParamHeaderID");
                     System.out.println("Req no is :" + REQNO);
                     Serializable[] params = { REQNO };
                     XMLNode xmlNode = (XMLNode)am.invokeMethod("getOrderReportDetailsXML" , params);
                     // Calling getOrderReportDetailsXML method to get the XML for the VO query
                     ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
                     xmlNode.print(outputStream);
                     System.out.println("After calling XML generation method" + outputStream.toString());
                     //Above sop will return the XML output which will help you in designing the template.
                     ByteArrayInputStream lo_inputStream = new ByteArrayInputStream(outputStream.toByteArray());
                     ByteArrayOutputStream lo_outputFile = new ByteArrayOutputStream();
                     System.out.println("Vishal 1");
                     // Pass the Template code and Application short name
                      try {
                         System.out.println("Vishal 2");
                   TemplateHelper.processTemplate(((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getAppsContext(),
                                                                                 "AR",//APPLICATION SHORT NAME
                                                                                  "XXCAPEXREQUESTRPT", //TEMPLATE_SHORT_CODE
                   ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage(),
                   ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getCountry(),
                   lo_inputStream,
                   TemplateHelper.OUTPUT_TYPE_PDF,
                   null,
                   lo_outputFile);
                         System.out.println("Vishal 3");

                     } catch (XDOException xe) {
                         throw new OAException("Exception Vishal 4:" + xe.getMessage());
                         //System.out.println("Vishal 4");

                     }
                     System.out.println("Vishal 5");
                     byte[] l_bytes = lo_outputFile.toByteArray();

                     lo_response.setContentLength(l_bytes.length);
                     lo_outputStream.write(l_bytes, 0, l_bytes.length);
                     lo_outputStream.flush();
                     lo_outputStream.close();
                 } catch (Exception e) {
                     lo_response.setContentType("text/html");
                     throw new OAException(e.getMessage(), OAException.ERROR);
                 }
                 pageContext.setDocumentRendered(false);
       }

Application Module (AM)
===============================================


import java.io.IOException;
import java.io.OutputStream;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
import oracle.apps.fnd.framework.server.OAViewObjectImpl;
import oracle.jbo.Row;
import oracle.apps.fnd.framework.OAViewObject;
import java.sql.CallableStatement;
import java.sql.SQLException;
import java.sql.Types;
import oracle.apps.fnd.framework.OARow;
import oracle.jbo.XMLInterface;
import oracle.jbo.domain.BlobDomain;
import oracle.xml.parser.v2.XMLNode;


public void initGenerateXMLData(String PHeaderID)
     {
       System.out.println("Entered the init Gen XML Method");
       AssetDispDetailsVOImpl vo =  getAssetDispDetailsVO1();
   System.out.print("its here " + PHeaderID);
       Integer PHeadID = Integer.valueOf(Integer.parseInt(PHeaderID));
       if (!vo.isPreparedForExecution()) {vo.executeQuery();}
          vo.clearCache();
          vo.setWhereClause("1=2");
          vo.setWhereClauseParams(null);
          vo.setWhereClause("REQUEST_NUMBER=:1");
          vo.setWhereClauseParam(0, PHeadID);
          vo.executeQuery();
       XMLNode xmlData = (XMLNode)vo.writeXML(4,XMLInterface.XML_OPT_ALL_ROWS);
       BlobDomain blob = new BlobDomain();
       OutputStream os=null;   
        try{ os = blob.getBinaryOutputStream();
            xmlData.print(os);
           } catch (IOException e) {} catch (SQLException e) {}
       System.out.println(os.toString());

     } 
public XMLNode getOrderReportDetailsXML(String PHeaderID) {
             //XMLNode lo_xmlNode;
             System.out.println("Inside the AM Method");
             AssetDispDetailsVOImpl vo =  getAssetDispDetailsVO1();
Integer PHeadID = Integer.valueOf(Integer.parseInt(PHeaderID));
if (!vo.isPreparedForExecution()){vo.executeQuery();}
vo.clearCache();
vo.setWhereClause("1=2");
vo.setWhereClauseParams(null);
vo.setWhereClause("REQUEST_NUMBER=:1");
vo.setWhereClauseParam(0, PHeadID);
vo.executeQuery();
XMLNode  lo_xmlNode = (XMLNode)vo.writeXML(-1, 0L);//OL Stands for XMLInterface.XML_OPT_ALL_ROWS which means to includes all rows in the view object's row set in the XML.
             return lo_xmlNode;
           }


For Multiple Nodes

if (pageContext.getParameter("generateRpt") != null)

    {

 

         

      String po_number = (String)pageContext.getTransactionValue("PO_NUM");

      System.out.println("The PO NUmber i s -----------------"+po_number);

      Serializable params[] = { fromDate, toDate, docNo, pendingType, reqNo ,po_number}; //

      Class paramType[] =

      { String.class, String.class, String.class, String.class,

        String.class,String.class }; //

      DataObject sessionDictionary = pageContext.getNamedDataObject("_SessionParameters");

      HttpServletResponse response = (HttpServletResponse)sessionDictionary.selectValue(null,

                                                           "HttpServletResponse");

      try

      {



        System.out.println("Inisde Generate Button Step 2");

        ServletOutputStream os = response.getOutputStream();

        if (ReportFormat1 != null && !ReportFormat1.equals(""))

        {

          if (ReportFormat1.equals("PDF"))

          {

            System.out.println("Inisde Generate Button Step 3");

            contentDisposition = "attachment;filename=Quotation Report.pdf";

            response.setHeader("Content-Disposition", contentDisposition);

            response.setContentType("application/pdf");

            bt = TemplateHelper.OUTPUT_TYPE_PDF;

          }

          if (ReportFormat1.equals("XLS"))

          {

            System.out.println("Inisde Generate Button Step 4");

            contentDisposition = "attachment;filename=Quotation Report.xls";

            response.setHeader("Content-Disposition", contentDisposition);

            response.setContentType("application/vnd.ms-excel");

            bt = TemplateHelper.OUTPUT_TYPE_EXCEL;

          }

        }

   ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); 

   byte bufutf[] ="<Testing>".getBytes();

   outputStream.write(bufutf);

   XMLNode xmlNode[] = new XMLNode[10];

   xmlNode = (XMLNode[])am.invokeMethod("executeReportPO",params,paramType);

   System.out.println(" IN CO");

   xmlNode[1].print(outputStream);

   xmlNode[2].print(outputStream);

   byte bufutf1[] ="</Testing>".getBytes();

   outputStream.write(bufutf1);

      System.out.println("Testying in ----------------"+outputStream.toString());

     

        ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());

        ByteArrayOutputStream fileData = new ByteArrayOutputStream();

        TemplateHelper.processTemplate(((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getAppsContext(),

                                       APP_NAME, TEMPLATE_CODE,

                                       ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage(),

                                       ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getCountry(),

                                       inputStream, bt, null, fileData);

        System.out.println("Inside template code");

        byte[] b = fileData.toByteArray();

        response.setContentLength(b.length);

        os.write(b, 0, b.length);

        os.flush();

        os.close();

        System.out.println("Inside template code1");

}

      catch (Exception e)

      {

        throw new OAException(e.getMessage());

      }



    }



AM Code :



  public XMLNode[] executeReportPO(String fromDate, String toDate,

                                   String docNo, String pendingType,

                                   String reqNo, String ponum)

  {



    System.out.println("Inisde Generate Button in AM Step 1" + ponum);

    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();



    ItemPendingPoVOImpl vo = getItemPendingPoVO1();

    PoDetailVOImpl vo1 = getPoDetailVO1();

    try

    {



      vo.setWhereClauseParams(null);

      vo.setWhereClauseParam(0, docNo);

      vo.setWhereClauseParam(1, reqNo);

      vo.setWhereClauseParam(2, fromDate);

      vo.setWhereClauseParam(3, toDate);

      vo.setWhereClauseParam(4, pendingType);



      vo.executeQuery();

      System.out.println("Query ---" + vo.getQuery());



      String whereconditionpo = "PONO='" + ponum + "'";

      vo1.setWhereClause(whereconditionpo);

      vo1.executeQuery();

      System.out.println("Query 2 --->" + vo1.getQuery());

      System.out.println("Inisde Generate Button Step 2 in AM");



    } catch (Exception e)

    {

      throw new OAException(e.getMessage());

    }



    int s = vo.getRowCount();

    System.out.println("fected row count" + s);

    XMLNode NodeList[] = new XMLNode[10];

    try

    {



      NodeList[1] = ((XMLNode)vo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS));

      ((XMLNode)vo.writeXML(4,

                            XMLInterface.XML_OPT_ALL_ROWS)).print(outputStream);

      System.out.println(outputStream.toString());

      System.out.println("Inisde Generate Button Step 1");

      NodeList[2] = ((XMLNode)vo1.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS));

      ((XMLNode)vo1.writeXML(4,

                             XMLInterface.XML_OPT_ALL_ROWS)).print(outputStream);

      System.out.println(outputStream.toString());



      return NodeList;

    } catch (Exception e)

    {

      throw new OAException(e.getMessage());

    }

  }


Oracle OAF : Displaying Exception Messages (Oracle Application Framework or OA Framework)

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
  super.processFormRequest(pageContext, webBean);
  if(pageContext.getParameter("Condition1")!=null)
   {
    String name=pageContext.getParameter("ItemAttributeID");
 /* This will throw an error with the message name entered in ItemAttributeID */
    throw new OAException(name,OAException.ERROR);
/*  throw new OAException("Custom Message",OAException.ERROR); */
   }
  if(pageContext.getParameter("Condition2")!=null)
   {
    String name=pageContext.getParameter("ItemAttributeID");
 /* This will give us the confirmation message entered in ItemAttributeID */
    throw new OAException(name,OAException.CONFIRMATION);
   }
  if(pageContext.getParameter("Condition3")!=null)
   {
    String name=pageContext.getParameter("ItemAttributeID");
 /* This will give us the warning message entered in ItemAttributeID */
    throw new OAException(name,OAException.WARNING);
   }
 
    if(pageContext.getParameter("Condition4")!=null)
   {
    String name=pageContext.getParameter("ItemAttributeID");
 /* This will give us the warning message entered in ItemAttributeID */
    throw new OAException(message, OAException.INFORMATION);
   }

}