21. Calling OAF Page from Another OAF Page

 

Calling a 10G Form from an Oracle Application Framework (OAF) Page

Introduction

Oracle E-Business Suite Release 12.2 combines two distinct user interface technologies: modern OAF (Oracle Application Framework) pages and legacy Oracle Forms (10G). In many real-world scenarios, you may need to navigate from a custom OAF page to a standard Oracle Forms-based page — for example, to open "Define Concurrent Programmes" directly from an OAF page.

OAF provides a built-in API called forwardImmediatelyToForm() that allows you to launch a 10G Form directly from an OAF page. This guide explains the syntax, provides a working example, and shows how to implement the navigation in your controller.


Understanding the Form Call Syntax

The syntax to call a 10G Form from an OAF page is:

text
form:<APPLICATION_SHORT_NAME>:<RESPONSIBILITY_KEY>:<DATA_GROUP>:<FUNCTION_NAME>

Syntax Breakdown

ComponentDescriptionExample
form:Prefix indicating a Form callform:
APPLICATION_SHORT_NAMEThe application short name (e.g., FND)FND
RESPONSIBILITY_KEYThe responsibility key under which the form runsSYSTEM_ADMINISTRATOR
DATA_GROUPThe data group nameSTANDARD
FUNCTION_NAMEThe function name associated with the formFND_FNDCPMCP_SYS

Complete Syntax

text
form:FND:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDCPMCP_SYS

Example: Calling "Define Concurrent Programmes" Form

Let's walk through a practical example of calling the Define Concurrent Programmes form from an OAF page.

Form Details

AttributeValue
Form NameDefine Concurrent Programmes
Responsibility NameSystem Administrator
Responsibility KeySYSTEM_ADMINISTRATOR
Function NameFND_FNDCPMCP_SYS
Data GroupSTANDARD

Constructing the Form Path

Using the syntax above, the form path becomes:

text
form:FND:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDCPMCP_SYS

Note: The application short name FND is used because this is an Oracle Foundation (FND) form. For forms belonging to other applications, use the appropriate application short name (e.g., AP for Payables, AR for Receivables).


Step-by-Step Implementation

Step 1: Create the OAF Page

  1. Create a New Page:

    • Right-click on your project

    • Select New → Page

    • Name the page (e.g., CallFormPG)

  2. Configure the Page:

    • Set the PageLayoutRN ID

    • Attach the Application Module

Step 2: Add a Button to the Page

  1. Create the Button:

    • Right-click on the main region

    • Select New → Item

    • An item is created

  2. Configure the Button:

PropertyValue
IDitem1
Item StylesubmitButton
PromptOpen Define Concurrent Programmes

Note: The button's ID (item1) is used in the controller to detect when the button is clicked.

Step 3: Create the Controller

  1. Create the Controller:

    • Right-click on PageLayoutRN

    • Select Set New Controller

    • Name the controller (e.g., CallFormCO)

Step 4: Add the Form Call Code

Open the controller file and add the following code in the Process Form Request block:

java
if (pageContext.getParameter("item1") != null)
{
    String FormPath = "form:FND:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDCPMCP_SYS";
    pageContext.forwardImmediatelyToForm(FormPath);
}

Code Explanation

LinePurpose
if (pageContext.getParameter("item1") != null)Checks if the button (item1) was clicked
String FormPath = "form:FND:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDCPMCP_SYS";Constructs the form path using the required syntax
pageContext.forwardImmediatelyToForm(FormPath);Navigates directly to the 10G Form

Important: The forwardImmediatelyToForm() method immediately transfers control to the Oracle Forms runtime, opening the specified form in a new window or the current window, depending on the configuration.


How It Works at Runtime

The following illustrates the complete flow:

text
┌─────────────────────────────────────────────────────────────────┐
│                        OAF PAGE                                 │
│  1. User opens the custom OAF page                              │
│  2. A button labeled "Open Define Concurrent Programmes" is     │
│     displayed                                                   │
│  3. User clicks the button                                      │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                  CONTROLLER (Process Form Request)              │
│  1. Detects that "item1" parameter is not null                  │
│  2. Constructs the form path:                                   │
│     form:FND:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDCPMCP_SYS     │
│  3. Calls pageContext.forwardImmediatelyToForm(FormPath)        │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                    10G FORM LAUNCHED                            │
│  1. Oracle Forms runtime opens                                  │
│  2. The "Define Concurrent Programmes" form is displayed        │
│  3. User can interact with the form as normal                   │
└─────────────────────────────────────────────────────────────────┘

Finding the Form Details

To call a different form, you need to identify four pieces of information:

1. Application Short Name

The application short name is typically the same as the form's owning application (e.g., FND, AP, AR, GL).

2. Responsibility Key

Find the responsibility key by querying the FND_RESPONSIBILITY table:

sql
SELECT responsibility_key, responsibility_name
FROM fnd_responsibility_vl
WHERE responsibility_name LIKE '%System Administrator%';

3. Function Name

Find the function name associated with the form:

sql
SELECT function_name, user_function_name, form_name
FROM fnd_form_functions_vl
WHERE user_function_name LIKE '%Concurrent Program%';

4. Data Group

The data group is typically STANDARD for most Oracle E-Business Suite forms.


Common Form Call Examples

FormForm Path
Define Concurrent Programmesform:FND:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDCPMCP_SYS
Define Responsibilitiesform:FND:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDSCRSP
Define Usersform:FND:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDSCUSR
Define Value Setsform:FND:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDSVSET
Define Key Flexfieldsform:FND:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDSKKF

Tip: The exact function name must match the FUNCTION_NAME in the FND_FORM_FUNCTIONS table. Always verify the function name before using it in the form path.


Best Practices

PracticeDescription
Verify Form DetailsAlways confirm the responsibility key and function name from the database
Use Standard ResponsibilitiesUse standard responsibilities (e.g., SYSTEM_ADMINISTRATOR) where possible
Handle ErrorsAdd exception handling in case the form path is invalid
Test NavigationTest the form call in a development environment first
Document Form PathsMaintain a list of commonly used form paths for reference
Consider SecurityEnsure the user has access to the responsibility and form

Troubleshooting Common Issues

IssuePossible CauseSolution
Form doesn't openInvalid form pathVerify the responsibility key, data group, and function name
"Function not found" errorWrong function nameQuery FND_FORM_FUNCTIONS for the correct name
"Responsibility not found" errorWrong responsibility keyQuery FND_RESPONSIBILITY for the correct key
Blank page after clickForm not deployedVerify the form is properly deployed and accessible
Permission deniedUser lacks accessEnsure the user has the required responsibility
Form opens in wrong languageLanguage settingsVerify the session language and form configuration

Required Import Statements

java
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;

Note: The forwardImmediatelyToForm() method is available on the OAPageContext object, so no additional imports are required beyond the standard OAF controller imports.


Summary

Calling a 10G Form from an OAF page involves the following key steps:

  1. Identify the Form Details: Application short name, responsibility key, data group, and function name

  2. Construct the Form Path: Using the syntax form:<APP>:<RESP_KEY>:<DATA_GROUP>:<FUNCTION>

  3. Add a Button: Create a submit button on the OAF page

  4. Create the Controller: Add a controller to the page

  5. Write the Navigation Code: Use pageContext.forwardImmediatelyToForm(FormPath) in the Process Form Request block

The forwardImmediatelyToForm() method is a powerful OAF API that provides seamless integration between modern OAF pages and legacy Oracle Forms. This is particularly useful during migration projects where some functionality remains in Forms while new pages are built in OAF.

Key Points to Remember

  • The responsibility key must be the key (not the name) of an existing responsibility

  • The function name must match the FUNCTION_NAME in the FND_FORM_FUNCTIONS table

  • The data group is typically STANDARD

  • The application short name is usually the form's owning application (e.g., FND)

  • The forwardImmediatelyToForm() method transfers control immediately—no additional navigation code is needed

By following this pattern, you can seamlessly integrate Oracle Forms into your OAF applications, providing users with a unified experience across both technologies.


References

  • Oracle E-Business Suite Documentation: Oracle Application Framework Developer's Guide

  • Oracle E-Business Suite Documentation: Oracle Forms Developer's Guide

  • My Oracle Support: How to Call a Form from an OAF Page

  • Related Guides: Creating a Hello World Page in OAF, Creating an LOV in OAF, Creating a Search Page in OAF

No comments:

Post a Comment