OAF: Launch Oracle Form (FMB/ D2K) from OAF Page

Given below is the code snippet to invoke Oracle Forms from OAF page. However, it can get tricky when you need to pass parameters. Read the use cases further below for illustrations.

Launch Oracle Form from OAF

1. Add a button or link on the OAF page using form personalization. Note if the ID of the button/link.
2. Extend the controller of the page and override the processFormRequest method as follows:
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { 
 super.processFormRequest(pageContext, webBean);

 if (pageContext.getParameter("Go") != null) { 
  // form:APPLICATION_SHORT_NAME:RESPONSIBILITY_KEY:DATA_GROUP_NAME:FORM_FUNCTION_NAME
  String destination =  "form:FND:APPLICATION_DEVELOPER:STANDARD:FND_FNDPOMPO"; 

  //Invoke the Form
  pageContext.forwardImmediatelyToForm(destination);               
 } 
}


Use Case#1: Launch Oracle PO Form from OAF to Create PO

Edit the destination string as follows to launch the PO Form:

String destination = "form:PO:PURCHASING_OPERATIONS_AIG:STANDARD:PO_POXPOEPO";


Use Case#2: Launch Oracle PO Form (with Parameters) from OAF to Edit PO

The parameters for a given form vary. The below-listed parameters are specific to a PO form. For other FMB forms, I would recommend to download the FMB and review it Oracle Forms Builder so that you can identify the parameters you need to pass.
 
  /**
    * Parameters: 
    * PO_HEADER_ID 
    * = poHeaderId => This is the document ID
    * 
    * ACCESS_LEVEL_CODE 
    *  = MODIFY => This indicates to open the form in edit mode
    *
    * POXPOEPO_CALLING_FORM 
    * = OAF => This is calling function name. 
    *    If your OAF page is registered as a function, 
    *    provide the function short name here
    *
    * G_QUERY_FIND 
    * = FALSE
    *
    */
 
    String destination = "form:PO:PURCHASING_OPERATIONS_AIG:STANDARD:PO_POXPOEPO:" 
       + "PO_HEADER_ID=\"" + poHeaderID 
       + "\" " + "ACCESS_LEVEL_CODE=\"MODIFY\" " 
       + "POXPOEPO_CALLING_FORM=\"OAF\" " 
       + "G_QUERY_FIND=\"FALSE\"";
 
    pageContext.forwardImmediatelyToForm(destination);



Please share your feedback below. Hope you find this helpful!

CaptiveCode