How to Create a Search Page in Oracle Application Framework (OAF)
Introduction
A Search Page in Oracle Application Framework (OAF) allows users to search for and view data from the database within an Oracle E-Business Suite application. It is one of the most common and fundamental page types in OAF development.
A typical search page consists of:
Search Criteria Region: Fields where users enter search parameters
Go Button: Executes the search query
Results Table: Displays the matching records
Action Icons: Update and Delete icons for each result row (added in separate guides)
This guide walks you through the complete process of creating a search page in OAF, from setting up the workspace to creating the required OAF objects.
Note: This topic is lengthy, so it is split into two parts:
Part 1 (this article): Creating the workspace, project, Entity Object, and View Object
Part 2: Creating the Application Module, OAF Page, Regions, Items, and Controller
Required OAF Objects for a Search Page
To create a search page in OAF, you need the following objects:
| # | Object | Full Name | Purpose |
|---|---|---|---|
| 1 | EO | Entity Object | Handles business rules and DML operations (required if the page supports update/delete) |
| 2 | VO | View Object | Provides data access and query capabilities |
| 3 | AM | Application Module | Container that manages access to the BC4J model objects |
| 4 | CO | Controller | Handles user interactions and application flow |
| 5 | PG | OAF Page | The user interface component |
Important: If the search page is read-only (no update or delete), an Entity Object is not strictly required. However, for a search page that will later support update and delete operations, the EO is essential.
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
The database table (e.g.,
XX_SUPPLIER_MASTER) exists in the database
Step 1: 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: RohitSearchPage
Click OK
Step 2: Configure the Project
Project Wizard:
The Project Wizard opens automatically
Click Next to proceed
Enter Project Details:
Project Name:
RohitSearchPageDefault Package:
rohit.oracle.apps.fnd.RohitSearchPage
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 (you can use other application short names likeakas appropriate).
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 3: 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 RohitSearchPage
Select New
Select Entity Object:
Navigate to Business Tier → ADF Business Components
Select Entity Object
Click OK
Configure the Entity Object:
Entity Object Name:
SupplierEODefault Package:
rohit.oracle.apps.fnd.RohitSearchPage.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
Note: The EO is required if the search page will support update or delete operations. For a purely read-only page, you can skip this step and base the View Object directly on a SQL query.
Step 4: Create the View Object (VO)
The View Object provides data access and query capabilities. It can be based on an Entity Object or on an independent SQL query.
Open the New Gallery:
Right-click on the project RohitSearchPage
Select New
Select View Object:
Navigate to Business Tier → ADF Business Components
Select View Object
Click OK
Configure the View Object:
View Object Name:
SupplierVODefault Package:
rohit.oracle.apps.fnd.RohitSearchPage.server
Select the Entity Object:
At Step 2 of the wizard, select SupplierEO from the left-hand side
Shuttle SupplierEO to the right-hand side
Click Next
Define the Query:
At Step 5 (Query), review or modify the SQL query. For example:
SELECT SUPPLIER_ID, SUPPLIER_NAME, SUPPLIER_SITE, CONTACT_PERSON FROM XX_SUPPLIER_MASTER
Continue through the wizard and click Finish
Complete the Wizard:
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 if the search page will support update or delete.
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 │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ SupplierEO │ │
│ │ (Encapsulates business rules, handles DML) │ │
│ └─────────────────────────────────────────────────────┘ │
└──────────────────────────┬──────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ VIEW OBJECT │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ SupplierVO │ │
│ │ (Based on SupplierEO, provides data 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 (created in Part 2) |
Directory Structure Overview
After completing Part 1, your project will have the following structure:
RohitSearchPage/ ├── server/ │ ├── SupplierEO.xml (Entity Object) │ └── SupplierVO.xml (View Object) └── (webui/, AM, 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 EO for DML | If the page will support update/delete, always base the VO on an EO |
| Follow Naming Conventions | Use consistent naming (EO, VO, AM suffixes) |
| Use Meaningful Names | Name objects descriptively (e.g., SupplierEO, SupplierVO) |
| Optimize Queries | Ensure VO queries are efficient and return only necessary columns |
| Test Database Connectivity | Verify the table exists and is accessible |
| Keep Objects Organized | Use the server directory for model objects |
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 |
| 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 |
| Query returns no data | Wrong table or columns | Test the SQL query directly in the database |
What's Next (Part 2)
Now that you have created the foundational objects, Part 2 of this guide will cover:
Creating the Application Module: The container for the View Object
Creating the OAF Page: The user interface component
Creating the Search Region: Fields for search criteria
Creating the Results Table: Displaying search results
Creating the Go Button: Executing the search
Creating the Controller: Handling search events
Implementing the Search Logic: Writing the query filter code
Rebuilding and Running: Compiling and testing the search page
Summary
Creating a search page in OAF begins with the following foundational steps:
Create the Workspace: Set up the development environment
Configure the Project: Use proper package naming conventions
Create the Entity Object: Encapsulates business rules and handles DML (required for update/delete support)
Create the View Object: Based on the EO, provides data access and query capabilities
The Entity Object is the backbone of any page that needs to modify data. By basing the View Object on the EO, the search page can later support update and delete operations. If the page is purely read-only, the EO can be skipped, and the VO can be based on a direct SQL query.
By completing Part 1, you have established the server-side data model for your search page. In Part 2, you will create the user interface (page, regions, items) and the Controller logic that ties everything together.
References
Part 1: Creating Search Page in OAF — https://docodi.blogspot.com/p/22-creating-oaf-search-page.html
Part 2: Creating Search Page in OAF (Continued) — https://docodi.blogspot.com/p/22b-creating-oaf-search-page.html
Oracle E-Business Suite Documentation: OA Framework Developer's Guide
Oracle JDeveloper Documentation: Available in the
jdevdocfolderRelated Guides: Creating a Data Entry Page in OAF, Update Page in OAF, Delete Records in OAF
No comments:
Post a Comment