18a. How to Create Data Entry Page In OAF – Part 1

 

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:

#ObjectFull NamePurpose
1EOEntity ObjectEncapsulates business rules and handles database DML operations
2VOView ObjectProvides data access and query capabilities based on the EO
3AMApplication ModuleContainer that manages access to the BC4J model objects
4PGOAF PageThe user interface component
5RGOAF RegionDefines layout and structure within the page
6COControllerHandles 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.

sql
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, and LAST_UPDATED_BY for audit purposes.


Step 2: Create a New Workspace

  1. Start the Workspace Wizard:

    • Right-click on Applications in the Application Navigator

    • Select New OA Workspace

  2. Name the Workspace:

    • Enter the workspace name: RohitDataEntryOaf

    • Click OK


Step 3: Configure the Project

  1. Project Wizard:

    • The Project Wizard opens automatically

    • Click Next to proceed

  2. Enter Project Details:

    • Project Name: RohitDataEntryOaf

    • Default 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.fnd portion is mandatory for OAF development. The fnd abbreviation represents the Oracle Application short name.

  1. Enter Runtime Connection Details:

    • Provide your Oracle E-Business Suite Username and Password

    • These are the same credentials you configured during JDev installation

  2. 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.

  1. Open the New Gallery:

    • Right-click on the project RohitDataEntryOaf

    • Select New

  2. Select Entity Object:

    • Navigate to Business Tier → ADF Business Components

    • Select Entity Object

    • Click OK

  3. Configure the Entity Object:

    • Entity Object Name: SupplierEntryEO

    • Default Package: rohit.oracle.apps.fnd.RohitDataEntryOaf.server

    • Schema Object: XX_SUPPLIER_MASTER (your table name)

Note: Entity Objects are always created under the server directory of the project, following OAF standards.

  1. 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.

  1. Open the New Gallery:

    • Right-click on the project RohitDataEntryOaf

    • Select New

  2. Select View Object:

    • Navigate to Business Tier → ADF Business Components

    • Select View Object

    • Click OK

  3. Configure the View Object:

    • View Object Name: SupplierEntryVO

    • Default Package: rohit.oracle.apps.fnd.RohitDataEntryOaf.server

  4. 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

  5. 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.

  1. Open the New Gallery:

    • Right-click on the project RohitDataEntryOaf

    • Select New

  2. Select Application Module:

    • Navigate to Business Tier → ADF Business Components

    • Select Application Module

    • Click OK

  3. Configure the Application Module:

    • Application Module Name: RohitDataEntryAM

    • Default Package: rohit.oracle.apps.fnd.RohitDataEntryOaf.server

Note: Application Modules are always created under the server directory of the project, following OAF standards.

  1. 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

  2. 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:

text
┌─────────────────────────────────────────────────────────────┐
│                    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

ObjectRoleRelationship
Entity ObjectBusiness rules and DMLDirect link to database table
View ObjectData access and queriesBased on Entity Object
Application ModuleContainer and access managerContains View Object

Directory Structure Overview

After completing Part 1, your project will have the following structure:

text
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 server directory contains all server-side business logic components. The webui directory (created in Part 2) will contain the user interface components.


Best Practices

PracticeDescription
Use WHO ColumnsInclude standard EBS audit columns in your table
Follow Naming ConventionsUse consistent naming (EO, VO, AM suffixes)
Base VO on EOFor data entry pages, always base the VO on an EO
Add VO to AMEnsure the VO is added to the Application Module
Use Meaningful NamesName objects descriptively (e.g., SupplierEntryEO)
Test Database ConnectivityVerify the table exists and is accessible

Troubleshooting Common Issues

IssuePossible CauseSolution
EO creation failsTable doesn't existVerify the table name and schema
VO doesn't show EOEO not selectedShuttle the EO to the right side in the wizard
AM doesn't show VOVO not selectedShuttle the VO to the right side in the wizard
Package name errorMissing oracle.apps.fndEnsure package includes the required prefix
Schema object not foundWrong table nameVerify the table name in the database
Connection errorInvalid credentialsVerify EBS username and password

What's Next (Part 2)

Now that you have created the foundational objects, Part 2 of this guide will cover:

  1. Creating the OAF Page: The user interface component

  2. Creating the Region: Defining the layout for data entry fields

  3. Adding Items: Creating text input fields for each column

  4. Creating the Controller: Handling page events and DML operations

  5. Implementing Insert Logic: Writing code to insert records into the database

  6. Implementing Commit Logic: Writing code to commit the transaction

  7. Rebuilding and Running: Compiling and testing the data entry page


Summary

Creating a data entry page in OAF involves the following key steps:

  1. Create the Database Table: The foundation for storing data

  2. Create the Workspace and Project: Set up the development environment

  3. Create the Entity Object: Encapsulates business rules and handles DML

  4. Create the View Object: Based on the EO, provides data access

  5. 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

No comments:

Post a Comment