How to Create a Data Entry Page in OAF
Introduction
A Data Entry Page in Oracle Application Framework (OAF) is a page that allows users to enter data which is then inserted into a backend database table. Unlike read-only pages, data entry pages require an Entity Object (EO) to handle insert, update, and delete operations against the database.
This guide walks you through the complete process of creating a data entry page, from creating the database table to configuring the required OAF objects.
Note: This topic is lengthy, so it is split into two parts:
Part 1 (this article): Creating the table, workspace, project, Entity Object, View Object, and Application Module
Part 2: Creating the OAF Page, Region, Controller, and implementing the data entry logic
Required OAF Objects for a Data Entry Page
To create a data entry page in OAF, you must create the following six objects:
| # | Object | Full Name | Purpose |
|---|---|---|---|
| 1 | EO | Entity Object | Encapsulates business rules and handles database DML operations |
| 2 | VO | View Object | Provides data access and query capabilities based on the EO |
| 3 | AM | Application Module | Container that manages access to the BC4J model objects |
| 4 | PG | OAF Page | The user interface component |
| 5 | RG | OAF Region | Defines layout and structure within the page |
| 6 | CO | Controller | Handles user interactions and application flow |
Important: If you are creating only a read-only OAF page, you do not need an Entity Object. The EO is mandatory only when you need to insert, update, or delete records.
Prerequisites
Before you begin, ensure the following:
Oracle JDeveloper is installed and configured with a valid Runtime Connection
Database Connection is established
You have an EBS user account with the necessary responsibilities
You have access to a database schema where you can create tables
Step 1: Create the Database Table
First, create the database table that will store the data entered through the OAF page.
CREATE TABLE XX_SUPPLIER_MASTER ( SUPPLIER_ID NUMBER PRIMARY KEY, SUPPLIER_NAME VARCHAR2(100), SUPPLIER_SITE VARCHAR2(100), CONTACT_PERSON VARCHAR2(100), CONTACT_EMAIL VARCHAR2(100), CREATION_DATE DATE DEFAULT SYSDATE, CREATED_BY NUMBER, LAST_UPDATE_DATE DATE, LAST_UPDATED_BY NUMBER );
Tip: In a real Oracle E-Business Suite environment, you would typically use the standard EBS columns (WHO columns) such as
CREATION_DATE,CREATED_BY,LAST_UPDATE_DATE, andLAST_UPDATED_BYfor audit purposes.
Step 2: Create a New Workspace
Start the Workspace Wizard:
Right-click on Applications in the Application Navigator
Select New OA Workspace
Name the Workspace:
Enter the workspace name: RohitDataEntryOaf
Click OK
Step 3: Configure the Project
Project Wizard:
The Project Wizard opens automatically
Click Next to proceed
Enter Project Details:
Project Name:
RohitDataEntryOafDefault Package:
rohit.oracle.apps.fnd.RohitDataEntryOaf
Important: The package name determines the directory structure where Java class files and other project files are stored. The
oracle.apps.fndportion is mandatory for OAF development. Thefndabbreviation represents the Oracle Application short name.
Enter Runtime Connection Details:
Provide your Oracle E-Business Suite Username and Password
These are the same credentials you configured during JDev installation
Complete the Wizard:
The workspace and project are now created
Step 4: Create the Entity Object (EO)
The Entity Object encapsulates business rules and handles database DML operations. It has a direct relationship with the database table.
Open the New Gallery:
Right-click on the project RohitDataEntryOaf
Select New
Select Entity Object:
Navigate to Business Tier → ADF Business Components
Select Entity Object
Click OK
Configure the Entity Object:
Entity Object Name:
SupplierEntryEODefault Package:
rohit.oracle.apps.fnd.RohitDataEntryOaf.serverSchema Object:
XX_SUPPLIER_MASTER(your table name)
Note: Entity Objects are always created under the server directory of the project, following OAF standards.
Complete the Wizard:
Click Next, then click Finish
The Entity Object is now created
Important: The EO is the backbone of a data entry page. It handles all insert, update, and delete operations against the underlying database table.
Step 5: Create the View Object (VO)
The View Object provides data access and query capabilities. For a data entry page, the VO is typically based on the Entity Object.
Open the New Gallery:
Right-click on the project RohitDataEntryOaf
Select New
Select View Object:
Navigate to Business Tier → ADF Business Components
Select View Object
Click OK
Configure the View Object:
View Object Name:
SupplierEntryVODefault Package:
rohit.oracle.apps.fnd.RohitDataEntryOaf.server
Select the Entity Object:
At Step 2 of the wizard, select SupplierEntryEO from the left-hand side
Shuttle SupplierEntryEO to the right-hand side
Click Next
Complete the Wizard:
Click Next, then click Finish
The View Object is now created
Note: When a VO is based on an EO, the VO inherits the EO's business rules and can participate in DML operations. This is essential for a data entry page.
Step 6: Create the Application Module (AM)
The Application Module is the container that manages access to the BC4J model objects. It provides the connection between the page and the View Object.
Open the New Gallery:
Right-click on the project RohitDataEntryOaf
Select New
Select Application Module:
Navigate to Business Tier → ADF Business Components
Select Application Module
Click OK
Configure the Application Module:
Application Module Name:
RohitDataEntryAMDefault Package:
rohit.oracle.apps.fnd.RohitDataEntryOaf.server
Note: Application Modules are always created under the server directory of the project, following OAF standards.
Add the View Object:
At Step 2 of the wizard, select SupplierEntryVO from the left-hand side
Shuttle SupplierEntryVO to the right-hand side
Click Next, then click Finish
Complete the Wizard:
The Application Module is now created with SupplierEntryVO attached
Important: Without adding the View Object to the Application Module, the page cannot access the data. The AM acts as the gateway to the model layer.
Understanding the Object Relationships
The following diagram illustrates how the objects created in Part 1 relate to each other:
┌─────────────────────────────────────────────────────────────┐
│ DATABASE TABLE │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ XX_SUPPLIER_MASTER │ │
│ │ (SUPPLIER_ID, SUPPLIER_NAME, SUPPLIER_SITE, ...) │ │
│ └─────────────────────────────────────────────────────┘ │
└──────────────────────────┬──────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ ENTITY OBJECT │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ SupplierEntryEO │ │
│ │ (Encapsulates business rules, handles DML) │ │
│ └─────────────────────────────────────────────────────┘ │
└──────────────────────────┬──────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ VIEW OBJECT │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ SupplierEntryVO │ │
│ │ (Based on SupplierEntryEO, provides data access) │ │
│ └─────────────────────────────────────────────────────┘ │
└──────────────────────────┬──────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ APPLICATION MODULE │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ RohitDataEntryAM │ │
│ │ (Contains SupplierEntryVO, manages access) │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘Object Roles
| Object | Role | Relationship |
|---|---|---|
| Entity Object | Business rules and DML | Direct link to database table |
| View Object | Data access and queries | Based on Entity Object |
| Application Module | Container and access manager | Contains View Object |
Directory Structure Overview
After completing Part 1, your project will have the following structure:
RohitDataEntryOaf/ ├── server/ │ ├── SupplierEntryEO.xml (Entity Object) │ ├── SupplierEntryVO.xml (View Object) │ └── RohitDataEntryAM.xml (Application Module) └── (webui/ and page will be created in Part 2)
Note: The
serverdirectory contains all server-side business logic components. Thewebuidirectory (created in Part 2) will contain the user interface components.
Best Practices
| Practice | Description |
|---|---|
| Use WHO Columns | Include standard EBS audit columns in your table |
| Follow Naming Conventions | Use consistent naming (EO, VO, AM suffixes) |
| Base VO on EO | For data entry pages, always base the VO on an EO |
| Add VO to AM | Ensure the VO is added to the Application Module |
| Use Meaningful Names | Name objects descriptively (e.g., SupplierEntryEO) |
| Test Database Connectivity | Verify the table exists and is accessible |
Troubleshooting Common Issues
| Issue | Possible Cause | Solution |
|---|---|---|
| EO creation fails | Table doesn't exist | Verify the table name and schema |
| VO doesn't show EO | EO not selected | Shuttle the EO to the right side in the wizard |
| AM doesn't show VO | VO not selected | Shuttle the VO to the right side in the wizard |
| Package name error | Missing oracle.apps.fnd | Ensure package includes the required prefix |
| Schema object not found | Wrong table name | Verify the table name in the database |
| Connection error | Invalid credentials | Verify EBS username and password |
What's Next (Part 2)
Now that you have created the foundational objects, Part 2 of this guide will cover:
Creating the OAF Page: The user interface component
Creating the Region: Defining the layout for data entry fields
Adding Items: Creating text input fields for each column
Creating the Controller: Handling page events and DML operations
Implementing Insert Logic: Writing code to insert records into the database
Implementing Commit Logic: Writing code to commit the transaction
Rebuilding and Running: Compiling and testing the data entry page
Summary
Creating a data entry page in OAF involves the following key steps:
Create the Database Table: The foundation for storing data
Create the Workspace and Project: Set up the development environment
Create the Entity Object: Encapsulates business rules and handles DML
Create the View Object: Based on the EO, provides data access
Create the Application Module: Container that manages access to the VO
The Entity Object is the most critical component for a data entry page. Unlike read-only pages, data entry pages require an EO to handle insert, update, and delete operations. The VO, based on the EO, inherits these capabilities and provides the data structure needed for the page.
By completing Part 1, you have established all the server-side components required for data entry. In Part 2, you will create the user interface and implement the logic to insert data into the database.
References
Part 1: How to Create Data Entry Page in OAF — https://rpforacle.blogspot.com/2013/03/how-to-create-data-entry-page-in-oaf.html
Part 2: Creating Data Entry Page in OAF (Continued) — https://docodi.blogspot.com/p/10b-how-to-create-data-entry-page-in.html
Oracle E-Business Suite Documentation: OA Framework Developer's Guide
Oracle JDeveloper Documentation: Available in the
jdevdocfolderRelated Guides: Creating an LOV in OAF, Creating a Pop List in OAF, Assigning Default Values in OAF
No comments:
Post a Comment