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:
form:<APPLICATION_SHORT_NAME>:<RESPONSIBILITY_KEY>:<DATA_GROUP>:<FUNCTION_NAME>
Syntax Breakdown
| Component | Description | Example |
|---|---|---|
| form: | Prefix indicating a Form call | form: |
| APPLICATION_SHORT_NAME | The application short name (e.g., FND) | FND |
| RESPONSIBILITY_KEY | The responsibility key under which the form runs | SYSTEM_ADMINISTRATOR |
| DATA_GROUP | The data group name | STANDARD |
| FUNCTION_NAME | The function name associated with the form | FND_FNDCPMCP_SYS |
Complete Syntax
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
| Attribute | Value |
|---|---|
| Form Name | Define Concurrent Programmes |
| Responsibility Name | System Administrator |
| Responsibility Key | SYSTEM_ADMINISTRATOR |
| Function Name | FND_FNDCPMCP_SYS |
| Data Group | STANDARD |
Constructing the Form Path
Using the syntax above, the form path becomes:
form:FND:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDCPMCP_SYS
Note: The application short name
FNDis used because this is an Oracle Foundation (FND) form. For forms belonging to other applications, use the appropriate application short name (e.g.,APfor Payables,ARfor Receivables).
Step-by-Step Implementation
Step 1: Create the OAF Page
Create a New Page:
Right-click on your project
Select New → Page
Name the page (e.g.,
CallFormPG)
Configure the Page:
Set the PageLayoutRN ID
Attach the Application Module
Step 2: Add a Button to the Page
Create the Button:
Right-click on the main region
Select New → Item
An item is created
Configure the Button:
| Property | Value |
|---|---|
| ID | item1 |
| Item Style | submitButton |
| Prompt | Open 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
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:
if (pageContext.getParameter("item1") != null) { String FormPath = "form:FND:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDCPMCP_SYS"; pageContext.forwardImmediatelyToForm(FormPath); }
Code Explanation
| Line | Purpose |
|---|---|
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:
┌─────────────────────────────────────────────────────────────────┐
│ 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:
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:
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
| Form | Form Path |
|---|---|
| Define Concurrent Programmes | form:FND:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDCPMCP_SYS |
| Define Responsibilities | form:FND:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDSCRSP |
| Define Users | form:FND:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDSCUSR |
| Define Value Sets | form:FND:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDSVSET |
| Define Key Flexfields | form:FND:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDSKKF |
Tip: The exact function name must match the
FUNCTION_NAMEin theFND_FORM_FUNCTIONStable. Always verify the function name before using it in the form path.
Best Practices
| Practice | Description |
|---|---|
| Verify Form Details | Always confirm the responsibility key and function name from the database |
| Use Standard Responsibilities | Use standard responsibilities (e.g., SYSTEM_ADMINISTRATOR) where possible |
| Handle Errors | Add exception handling in case the form path is invalid |
| Test Navigation | Test the form call in a development environment first |
| Document Form Paths | Maintain a list of commonly used form paths for reference |
| Consider Security | Ensure the user has access to the responsibility and form |
Troubleshooting Common Issues
| Issue | Possible Cause | Solution |
|---|---|---|
| Form doesn't open | Invalid form path | Verify the responsibility key, data group, and function name |
| "Function not found" error | Wrong function name | Query FND_FORM_FUNCTIONS for the correct name |
| "Responsibility not found" error | Wrong responsibility key | Query FND_RESPONSIBILITY for the correct key |
| Blank page after click | Form not deployed | Verify the form is properly deployed and accessible |
| Permission denied | User lacks access | Ensure the user has the required responsibility |
| Form opens in wrong language | Language settings | Verify the session language and form configuration |
Required Import Statements
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 theOAPageContextobject, 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:
Identify the Form Details: Application short name, responsibility key, data group, and function name
Construct the Form Path: Using the syntax
form:<APP>:<RESP_KEY>:<DATA_GROUP>:<FUNCTION>Add a Button: Create a submit button on the OAF page
Create the Controller: Add a controller to the page
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_NAMEin theFND_FORM_FUNCTIONStableThe data group is typically
STANDARDThe 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