Tuesday, January 6, 2015

Search Page in OAF

Pre-Requisite

i.                     Table Creation Script

CREATE TABLE XX_OAF_DEMO_STG
(
   record_id           NUMBER,
   person_type         VARCHAR2 (100),
   person_name         VARCHAR2 (200),
   email_addresss      VARCHAR2 (100),
   contact_number      VARCHAR2 (100),
   last_update_date    DATE,
   last_updated_by     NUMBER,
   creation_date       DATE,
   created_by          NUMBER,
   last_update_login   NUMBER
);

ii.                   Insert Statements

INSERT INTO xx_oaf_demo_stg (record_id,
                             person_type,
                             person_name,
                             email_addresss,
                             contact_number,
                             last_update_date,
                             last_updated_by,
                             creation_date,
                             created_by,
                             last_update_login)
     VALUES (1,
             'Customer',
             'ABC Customer',
             'info@abc.com',
             '100-200-300',
             SYSDATE,
             -1,
             SYSDATE,
             -1,
             -1);


INSERT INTO xx_oaf_demo_stg (record_id,
                             person_type,
                             person_name,
                             email_addresss,
                             contact_number,
                             last_update_date,
                             last_updated_by,
                             creation_date,
                             created_by,
                             last_update_login)
     VALUES (2,
             'Customer',
             'XYZ Customer',
             'info@xyz.com',
             '200-200-300',
             SYSDATE,
             -1,
             SYSDATE,
             -1,
             -1);

INSERT INTO xx_oaf_demo_stg (record_id,
                             person_type,
                             person_name,
                             email_addresss,
                             contact_number,
                             last_update_date,
                             last_updated_by,
                             creation_date,
                             created_by,
                             last_update_login)
     VALUES (3,
             'Supplier',
             'ABC Supplier',
             'info@abcs.com',
             '100-300-300',
             SYSDATE,
             -1,
             SYSDATE,
             -1,
             -1);

INSERT INTO xx_oaf_demo_stg (record_id,
                             person_type,
                             person_name,
                             email_addresss,
                             contact_number,
                             last_update_date,
                             last_updated_by,
                             creation_date,
                             created_by,
                             last_update_login)
     VALUES (4,
             'Supplier',
             'XYZ Supplier',
             'info@xyzs.com',
             '100-300-400',
             SYSDATE,
             -1,
             SYSDATE,
             -1,
             -1);


 Step 1:  Create a New Work space and Project



Step 2:  Create a New Entity Object


Right click on SearchWS -> Business Tier -> Entity Object


Name
SearchEO
Package
oracle.apps.fnd.searchproj.server
Schema Object
XX_OAF_DEMO_STG



Check the Accessors, Create Method, Validation Method and Remove Method

Step 3:  Create a New View Object (VO)


Select SearchEO


In Java page deselect Generate Java file for View Object Class: SearchVOImpl and Select Generate Java File for View Row Class: SearchVORowImpl

Step 4:  Attach View Object (VO) to Application Module (AM)


Step 5:  Create a New OA Page


Update the properties
ID
PageLayoutRN
Region Style
pageLayout
AM Definition
oracle.apps.fnd.searchproj.server.SearchAM
Window Title
Search Page
Title
Search Page



Step 6:  Create a New Query Region


Update the properties

ID
QueryRN
Region Style
query
Construction Mode
autoCustomizeCriteria


Step 7: Create a New table (Query) Region 

Application Module
oracle.apps.fnd.searchproj.server.SearchAM
Available View Usages
SearchVO


Region ID
SearchTable
Region Style
table



Change Style with “messageStyledText

Update Width -> 100%

Step 8: Create a Simple Search Panel

ID
SearchHeaderRN
Region Style
messageComponentLayout

Step 9: Create a Simple Search Panel Input Fields

ID
SearchPersonType
Region Style
messageTextInput
Search Allowed
True
Prompt
Person Type
CSC Class
OraFieldText


ID
SearchPersonName
Region Style
messageTextInput
Search Allowed
True
Prompt
Person Name
CSC Class
OraFieldText


Step 10: Create a Simple Search Query Mappings

ID
SearchPersonTypeMap
Search Item
SearchPersonType
Results Item
PersonType


Add a New Query Map

ID
SearchPersonNameMap
Search Item
SearchPersonName
Results Item
PersonName


Step 11: Save all your work and Run SearchPG.xml



Congratulations, you have done it!

5 comments: