Monday Aug 06, 2012

Entity Object Extension in OAF

In the exercise we have taken “Create Data Entry OAF Page“can be found @

https://blogs.oracle.com/prajkumar/entry/insert_data_oaf_page

 

We are going to extend InsertEO. Our business requirement is to add Validation on Column1. The length of entered data in Column1 should be more than 5 Characters.

 

 

1. FTP this project from application server and open in JDeveloper

 

2. Create a New Entity Object (EO)

Right click on InsertDemo > New > ADF Business Components > Entity Object

 

Name – ExtInsertEO

Package -- prajkumar.oracle.apps.fnd.insertdemo.schema.server

Extends -- prajkumar.oracle.apps.fnd.insertdemo.schema.server.InsertEO

 

 

 

Click on Next - > New from Table

 

 

Include all the attributes of parent EO

 

 

Next -> Next

 

Check Validation Method check box and Finish

 

 

3. Add following code in ExtInsertEOImpl.java

 

import oracle.apps.fnd.framework.OAException;
 
protected void validateEntity()
{
 super.validateEntity();

 String column1Value = getColumn1();

 if (column1Value.length() < 5)
 {
  String message = "Length of String" + " " + column1Value + "is less than 5 characters";
  throw new OAException(message, OAException.INFORMATION);
 }
}

 

4. Substitute your New EO with parent EO

Right click on InsertDemo > Project Properties > Business Components > Substitutions

In Available list select InsertEO and in Substitute list select New EO ExtInsertEO and click on Add and then Ok

 

 

5. After substitution import *.jpx

In our case it will modify InsertDemo.jpx at project location

i.e. -- D:\xxxx\jdevhome\jdev\myclasses

 

Open Command Prompt and go to following location of your project

D:\xxxx\jdevbin\oaext\bin

Use this Import Command to import jpx

 

 

6. Bounce the server

 

7. Verify the substitution has applied properly

Run InsertPG page and click on About this Page link

 

 

 

Expand Business Component References Details

Under that section click on InsertVO which is EO based [it should be ExtInsertEO based]

 

 

 

 

8. Congratulation you have successfully finished. Run Your InsertPG page and Test Your Work

 

 

 

About

Welcome to My Oracle World Puneet Rajkumar

Search

Categories
Archives
« August 2012 »
SunMonTueWedThuFriSat
   
2
3
5
7
8
9
10
11
12
13
14
16
17
19
20
21
22
23
24
25
26
27
28
29
30
31
 
       
Today