Thursday, 16 August 2018

DML operation in oaf

DML operation in oaf

In this post, we will discuss , how we can perform DML operations in oaf. How we can create Record Insert , delete and update OAF page. We can perform all the operations In oaf but we need to perform some steps to do that. We need to handle these operations in our Controller and Application module java classes. Here below I will share the Detail steps for DML operation in oaf.
In this DML operation in oaf , I will be share Three different Examples:-
1. Insert Page in OAF.
2.Delete in OAF
3.Update in OAF.

Insert DML operation in oaf

Step1 :First we will create table on which we insert Data.
DML operation in oaf
Create a new workspace name "RohitDataEntryOaf".
Right Click on "Applications".Click on "NewOAWorkspace".



Enter the name of Workspace="RohitDataEntryOaf".Click Ok.
DML operation in oaf

 Project wizard will open click next.

Enter the name of the Project="RohitDataEntryOaf".
Default Package= "rohit.oracle.apps.fnd.RohitDataEntryOaf"

Package determines the directory where the java class files and other files related to this project strored.
In this directory oracle.apps.fnd must be required."fnd" is the oracle application shortname you can use other applications like "ak" in this.
DML operation in oaf
Enter the RunTime connection .Enter the E-business Suit Application User Name and Password.(already explained in the JDev installation).


DML operation in oaf


Workspace and project has been created.

If we have to insert data we have to use EO.
TO create Entity Object(EO).

Right Click on the project "RohitDataEntryOaf".Click New
DML operation in oaf
Enter the Entity Object name="SupplierEntryEO"

Defualt Package="rohit.oracle.apps.fnd.RohitDataEntryOaf.server"

Schema Object = XX_SUPPLIER_MASTER               //Your Table Name.

we create "Entity Object" under the "Server" directory of the project as OAF Standard.

Click Next.

Click next and then finish.
DML operation in oaf


EO has been create as below.
DML operation in oaf
Now we create a View Object(VO) which is based on Entity Object(EO).

Right Click on the project "RohitDataEntryOaf".Click New
DML operation in oaf
 Enter the View Object name="SupplierEntryVO"

Defualt Package="rohit.oracle.apps.fnd.RohitDataEntryOaf.server"

we create "View Object" under the "Server" directory of the project as OAF Standard.

Click Next.

Select the "SupplierEntryEO" in the left hand side and then shuttle this to the right and then click Next.
DML operation in oaf
 Click Next and then Finish.

View Object has created as below.
Now  we create "Application Module".

Right Click on the project "RohitDataEntryOaf".Click New
DML operation in oaf
 Application Module wizard has open as below click next

Enter the Application Module name="RohitDataEntryAM"

Defualt Package="rohit.oracle.apps.fnd.RohitDataEntryOaf.server"

we create "Application module" under the "Server" directory of the project as OAF Standard.
Click next and then finish.


DML operation in oaf
.
Select the "SupplierEntryVO" in the left hand side and then shuttle this to the right and then click next and then finish.
DML operation in oaf

Application Module has created as Below.
DML operation in oaf


 Now we create OAF Page.

Right Click on the project "RohitDataEntryOaf".Click New
 Enter the Page Name="RohitDataEntryPG"

Default Package="rohit.oracle.apps.fnd.RohitDataEntryOaf.webui"

we create the page under the webui under the project directory

Click Ok Page has been created.

Below in the Structure Page Click on "region1"
Repalce the ID of the "region1" with "PageLayoutRN" in the property inspector.

 Click on the "PageLayoutRN".On the right hand side In the property inspector we  will set the AM for the this page
AM Definition=rohit.oracle.apps.fnd.RohitDataEntryOaf.server.RohitDataEntryAM.
Right Click on the "PageLayoutRN" and then new and then click  region.
 Then region2 has created.

Replace the region2 ID with "MainRN" in the proeprty Inspector.
Change the Region Style=messageComponentLayout,
 Right Click "MainRN".Click New and then Click messageTextInput.
Item1 has created.

Same as like this Create item2,item3,item4,item5,item5,item6.

Now set Values in the property inspector Window for item1.

ID=SupplierId
ViewInstance=SupplierEntryVO
ViewAttribute=SupplierId
Prompt=Supplier No.
Proeprty for item2.

ID=SupplierName
ViewInstance=SupplierEntryVO
ViewAttribute=SupplierName
Prompt=SupplierName


Proeprty for item3.

ID=SupplierAlias
ViewInstance=SupplierEntryVO
ViewAttribute=SupplierAliasName
Prompt=Supplier Alias Name

Proeprty for item4.

ID=SupplierCreationDate
ViewInstance=SupplierEntryVO
ViewAttribute=SupplierCreationDate
Prompt=Supplier Creation Date

Proeprty for item5.

ID=Adress1
ViewInstance=SupplierEntryVO
ViewAttribute=Address1
Prompt=Address1

Proeprty for item6.

ID=Adress2
ViewInstance=SupplierEntryVO
ViewAttribute=Address1
Prompt=Address2


Now we have to write the code for insert data so we need the Controller.

Creeate Controller.

Right Click on "PageLayoutRN".Click Set New Controller.

Enter The Controller Name=RohitDataEntryCO
Package=rohit.oracle.apps.fnd.RohitDataEntryOaf.lov

Put code in the Process Form Request Block as below

OAApplicationModule am=(OAApplicationModule)pageContext.getApplicationModule(WebBean).
am.invokeMethod("create_record");


Click on your Application Module "RohitDataEntryAM" then under Structure Window it shows the RohitDataEntryAMImpl.java

Create two  methods under the RohitDataEntryAMImpl.java
1.


public void createrecord()
{
  OAViewObject vo=(OAViewObject)getSupplierEntryVO();
 
  if(!vo.isPreparedForExecution())
  {
    vo.executeQuery();
  }
 
Row row=vo.createRow();

vo.insertRow(row);

row.setNewRowState(Row.STATUS_INITIALIZED);

}\\\


2.



public void saverecord()
{
  getTransaction().commit();
 
}






Right Click on "PageLayoutRN".Click New.Click Region.

Region1 has created.
ID=PageButtons
Change the Region Style for region1 is "pageButtonBar".

Right Click on PageButtons Region.Click New.Click Item
 item1 has created under "PageButtons" region.
Change the item1 Proeprty
ID=Save
Item Style=submitButton.


 Write code under the Process Form Request Block under the contrller "RohitDataEntryCO"


  public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule oa=(OAApplicationModule)pageContext.getApplicationModule(webBean);
    if(pageContext.getParameter("Save")!=null)
    {
    oa.invokeMethod("saverecord",null);
    }
  }


After this Right Click on the project "RohitDataEntryOaf" and then Click Rebuild.

Rebuild is the compilation of the project.

After successful compilation , Right Click on the page "RohitDataEntryPG".
Click Run.


DML operation in oaf




DML operation in oaf

Delete in OAF

You can refer this post to get the detailed steps for How to do Delete operation in OAF

VO substitution steps in oaf

VO substitution steps in oaf

In this post , I will share VO substitution steps in oaf. What it means vo substitution oaf. VO substitution means to put the customize VO in place standard VO. So this customize VO will substitute that Standard VO in each place where It was using earlier in the OAF pages. Now after the VO substitution , the new customize VO will be work in place of Standard VO. This process is called VO substitution. vo substitution Requirment comes when we have an requirement to show some additional information's in the OAF page , for which our standard VO is not have that information's so for this case we creates our customize VO and then substitute this Customize VO with the Standard VO so that this customize VO can work on the OAF pages in place of the Standard VO. vo substitution oaf has some rules ,which we need to follow while doing vo substitution other wise we can get errors during runtime of the OAF page in application. Here below is the Detail VO substitution steps in oaf.

VO substitution steps in oaf:-

1.Indentify that Which VO we need to Extend
2. Download the VO from Oracle Java_Top Location to Your Local Desktop under My Projects folder of Your JDev setup.
3.Then We create New view Object(VO) which extends the Standard View Object.
4.Then We substitute the New Custom View Object with the Standard View Object.
5.Then we upload the New Custom View Object to Oracle Java_Top Location.
6.Then we Register the New View Object in the Oracle application Through XML Importer script.
8.After Import/Register , We add the new field in the OAF page through Personalization and then give reference in this Field for the New Custom View Object(VO).

VO substitution steps in oaf

Step1:- First Go to your OAF page in the application , in which you will do View Object Extension.
This is the Page in which we will do View Extension. Here I want to display the DFF attribute5 in this Track Submitted Expense Reports Status Window.
VO substitution steps in oaf

Step2:- To see the Properties of this Page and to know which View Object is working behind this Page. for this we need to go to 'About this Page' in the Bottom of the Page.
VO substitution steps in oaf
Step3:- Click on the Expand All option and in the Controller Section you can see the Controller Name
VO substitution steps in oaf
Step4:-Click '+' icon for Business Components References Details.
VO substitution steps in oaf
Step5:- This is the Location of the View Object under Java_Top under which you will do Extension.
VO substitution steps in oaf
Step6:-
 Now you get to know that where is your Standard View Object is Placed in the Oracle application Under Java_Top.

Then you Need to go to Server Under Java_Top then Under Java_Top follow the same path 'oracle/apps/ap/oie/webui/' and copy the 'TrackExpesneReportsVO' from Server to your Local Desktop.

One Important Thing.

You need to create the same path in your JDev folder under' 'jdevhome'
Under JdevHome there is MyProjects' folder under this folder you have to Create same folder structure like oracle/apps/ap/oie/server/' and then this copied file 'TrackExpesneReportsVO' in this Location.

The rule is you have to create same folder structure like the Folder Structure created for The Standard Controller in the Application server Java_Top.

VO substitution steps in oaf


Step6:-This is the steps you have to implement before doing Start Extension in the JDeveloper.

Step7:- Now open the JDeveloper.

VO substitution steps in oaf




Step8:- Now we will create OA Workspace and Project to do Controller Extensions.


VO substitution steps in oaf

Step9:- Give the Name of OA Workspace. Click Ok.
OAF VO Extension

Step10:- Now Give the Name of the Project same like OA workspace.
Package Path:- Choose the same like Standard View Object but choose the application Top start with xx like this this change 'xxap'.
VO substitution steps in oaf

Step11:- Then Finish this Project.
VO substitution steps in oaf

Step12:- Now you can see your OAF Project has been completed. Now we will do Controller Extension under this Project.
VO substitution steps in oaf



Due to the Length of this Topic , I will split this Topic two Posts. Please find the Second Part of this Post as below

Part2 url:- https://rpforacle.blogspot.in/2018/03/oaf-vo-extension-how-to-add-new-column-in-the-expense-report-summary-home-page.html
VO substitution steps in oaf

VO substitution oaf

VO substitution oaf

In this post , we will discuss about vo substitution oaf. What it means vo substitution oaf. VO substitution means to put the customize VO in place standard VO. So this customize VO will substitute that Standard VO in each place where It was using earlier in the OAF pages. Now after the VO substitution , the new customize VO will be work in place of Standard VO. This process is called VO substitution. vo substitution oaf Requirment comes when we have an requirement to show some additional information's in the OAF page , for which our standard VO is not have that information's so for this case we creates our customize VO and then substitute this Customize VO with the Standard VO so that this customize VO can work on the OAF pages in place of the Standard VO. vo substitution oaf has some rules ,which we need to follow while doing vo substitution other wise we can get errors during runtime of the OAF page in application. Here below is the Detail step by step process of vo substitution oaf 
 

VO substitution oaf Steps:-

 
1.Indentify that Which VO we need to Extend
2. Download the VO from Oracle Java_Top Location to Your Local Desktop under My Projects folder of Your JDev setup.
3.Then We create New view Object(VO) which extends the Standard View Object.
4.Then We substitute the New Custom View Object with the Standard View Object.
5.Then we upload the New Custom View Object to Oracle Java_Top Location.
6.Then we Register the New View Object in the Oracle application Through XML Importer script.
8.After Import/Register , We add the new field in the OAF page through Personalization and then give reference in this Field for the New Custom View Object(VO).
 

VO substitution oaf Example: How to add new Column in the Expense Report Summary Home Page

 
Step1:- First Go to your OAF page in the application , in which you will do View Object Extension.
This is the Page in which we will do View Extension. Here I want to display the DFF attribute5 in this Track Submitted Expense Reports Status Window.
 
VO substitution oaf

 
 
Step2:- To see the Properties of this Page and to know which View Object is working behind this Page. for this we need to go to 'About this Page' in the Bottom of the Page.
 
VO substitution oaf
 
 
Step3:- Click on the Expand All option and in the Controller Section you can see the Controller Name
 
VO substitution oaf
 
 
 
Step4:-Click '+' icon for Business Components References Details.
 
OAF VO Extension
 
 
Step5:- This is the Location of the View Object under Java_Top under which you will do Extension.
 
VO substitution oaf
 
Step6:-
 
 Now you get to know that where is your Standard View Object is Placed in the Oracle application Under Java_Top.

Then you Need to go to Server Under Java_Top then Under Java_Top follow the same path 'oracle/apps/ap/oie/webui/' and copy the 'TrackExpesneReportsVO' from Server to your Local Desktop.

One Important Thing.

You need to create the same path in your JDev folder under' 'jdevhome'
Under JdevHome there is MyProjects' folder under this folder you have to Create same folder structure like oracle/apps/ap/oie/server/' and then this copied file 'TrackExpesneReportsVO' in this Location.

The rule is you have to create same folder structure like the Folder Structure created for The Standard Controller in the Application server Java_Top.
 
VO substitution oaf
 
 
Step6:-This is the steps you have to implement before doing Start Extension in the JDeveloper.
 
Step7:- Now open the JDeveloper.
 
VO substitution oaf
 
 
 
 
Step8:- Now we will create OA Workspace and Project to do Controller Extensions.
 

VO substitution oaf
 
Step9:- Give the Name of OA Workspace. Click Ok.
OAF VO Extension
 
 
Step10:- Now Give the Name of the Project same like OA workspace.
Package Path:- Choose the same like Standard View Object but choose the application Top start with xx like this this change 'xxap'.
VO substitution oaf
 

Step11:- Then Finish this Project.
VO substitution oaf

Step12:- Now you can see your OAF Project has been completed. Now we will do Controller Extension under this Project.
OAF VO Extension



Due to the Length of this Topic , I will split this Topic two Posts. Please find the Second Part of this Post as below

Part2 url:- https://rpforacle.blogspot.in/2018/03/oaf-vo-extension-how-to-add-new-column-in-the-expense-report-summary-home-page.html