VO Extension is a process of extending the existing VO to accomodate new business requirements.Classic example for VO extension is to add an database driven extra field to the page.
Â
Don't have an Vision instance to practice these tutorials? Visit http://cholagls.com/products-/11i-virtual-machine for details.Our smart solution to smart people like you !!

OAF R12 Tutorials by Aarthi Sudhakar is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License.
Summary
Below are the Summarized steps for VO Extension.
1) Identify the right VO from about this page.
2) Export the related files to JDEV from Server.
3) Create a new VO which extends the old VO.
4) Add the new attribute to the new VO.
5) Perform the BC4J Substitution.
6) FTP the new VO xml and Class files to the server.
7) Use jpximport to import the substitution.
8) Add personalization to expose the new attribute on the page.
Initial Steps
So what we do here is we go to the page where all the attributes are displayed and click About this page on the left hand side bottom corner. Click on Expand All to see all the attributes.
This is done to check which VO is used. Check where the attributes are displayed and see the corresponding VO which is used.

In our case it is the EmployeeSummaryVO. Click on the EmployeeSummaryVO1 to see if Salary attribute is there or not.In the attributes section you can see that Salary attribute is not there.
So we are going to extend the VO to include the salary attribute.We will not be changing in the current VO but we will create a new VO and do a VO Substitution.
Since we have all the project content already in the jdeveloper we will not be importing any files from the server. If the project is not there then we need to import and add the files to the jdeveloper.
Let us see how to do that.
View Object
1.Right click the CholasTutorial project and click New.Go to Business Tier ->ADF Business Components - > View Object.

Name - EmployeeSummaryExtVO
Package - cholaext.oracle.apps.fnd.extend.employee.server
Extends - chola.oracle.apps.fnd.employee.server.EmployeeSummaryVO
Click on Browse and select the chola.oracle.apps.fnd.employee.server.EmployeeSummaryVO.Click Ok.Since we have extending the current VO we need to choose the VO from the extends property.
2.Select the Salary attribute from EmployeeEO and shuttle it to the right side.There will be a message dialog asking if you want to override.Click Ok.Right now the salary attribute will be a Transient one.
3.In the SQL Statement you need to include EmployeeEO.Salary before the from clause to include the attribute.
4.Deselect the First option in creating the java files and select the second one.Click Next and Finish.

If you had added only chola folder to jdev then you wont be able to see the cholaext folder. So right click on the project -> Add to project Content.Select the included tab.Click Add and then choose the cholaext and click Ok.
For making the Salary variable Persistent save your work and close jdev.Go to the file system where you have installed jdeveloper.
Edit the EmployeeSumamryExtVO.xml.Find for the View Attribute Salary.We need to set some property for salary.
Replace the values under the salary attribute to:
Name="Salary"
EntityAttrName="Salary"
EntityUsage="EmployeeEO">
Double click on EmployeeSummaryExtVO and check the Salary attribute.

VO Substitution
5.Now we have to specify the substitution for the VO.Right click on your project->Project Properties.Go to Business Components -> Substitutions. From the available select the chola.oracle.apps.fnd.employee.server.EmployeeSummaryVo and in the substitute select cholaext.oracle.apps.fnd.extension.employee.server.EmployeeSummaryExtVo.

Click Add.

We are going to substitute the VO while run time.So we substitute the EmployeeSummaryVO with the EmployeeSummaryExtVO.
6.Select Run/Debug and click Edit.Since we are going to run from the jdeveloper itself we edit the java options. Go to the end and give a space and then continuosly type the following and click Ok.               Â
-Djbo.project=CholasTutorial. CholasTutorial is the project name.

Save Your work and Run the page.
Through personalization we are going to include the salary field.
Save and Run
After you run the page click on Personalize page on top right hand corner to include the salary attribute to the page.
Click on Complete View.To create a new item go to the resultsTable and Click on the create item icon.
Set the following properties for the item:
Item Style - Message Styled Text
ID - Salary
DataType - NUMBER
Prompt - Salary
View Attribute - Salary
View Instance - EmployeeSummaryVO1
Click Apply.
Save the work and Run the EmpSearch Page.Search for an employee and you can see that Salary is displayed.

Related Posts:

Wesley Isalberti
said:
|
... Hi Aarthi, I'm common problem and can not solve ... I have to enter a value in a field depending on the value of another field in a page request. Already created another VO and PM extended, so that I have not found a way to do this. Is that possible? Thanks, Wesley Isalberti |
|

















