Beruflich Dokumente
Kultur Dokumente
Navigate to Business Components tab and use the connection which has been created. You
can create a new connection if it is not available and then can use the same. (shown below is using
existing connection)
It might ask for password verification. If it asks, enter the password and click ok.
Once project properties are set, we are good to proceed with Entity Object creation.
Right click on server directory (oracle.apps.training.oaf.server) and click on New Entity Object as
shown below
Name: EmployeeEO
Package: oracle.apps.training.oaf.server
You can create new attributes or remove existing attributes from entity object. But for this exercise,
dont do anything and click Next
Following page (Step 3 of 5) will appear listing all attribute related details. By default, it will populate
Primary key, mandatory, persistent, queryable, updateable check as per the database columns. We
need not modify anything as such on this page as well.
Ensure that there is exactly one attribute marked as primary key. If you have table without primary
key then you can create a new attribute in this entity object which can be marked as primary key.
Avoid using ROWID as primary key.
1. For columns that are never updateable, or updateable only when new, select the
appropriate Updateable radio button.
2. For columns whose values change after database triggers execute, select the Refresh
After update or insert as appropriate.
3. Never select the Unique checkbox; uniqueness checking should always be performed
programmatically. The Unique property has no effect if the EO is created on an already existing
database table.
4. The Discriminator column is used for polymorphic entity objects
5. If you are using an Object Version Number column, select the Change Indicator checkbox
for it.
6. For primary key columns, ensure that the Primary Key and Mandatory checkboxes are
selected.
7. All database column attributes have the Persistent and Queriable checkboxes selected as
shown.
Click next and following page (Step 4 of 5) will appear. This page is to select which java file to be
generated. By default, Entity object class will be checked and its accessors. Generally, we will not
generate Collection and definition class of entity object. Hence keep the default checked boxes as it
is. And click next
Last step (step 5 of 5) will ask if you need to generate default view object. Keep the default settings
(i.e. unchecked) and click on Finish.
It will generate EmployeeEO under server directory in Applications Navigator. Moreover it will also
show 2 files: EmployeeEO.xml and EmployeeEOImpl.java in Structure window as shown below:
2. View Object Creation (EO Based)
Right click server directory (oracle.apps.training.oaf.server) and click on New View Object as shown
below.
Package: oracle.apps.training.oaf.server
Name: EmployeeVO
Select Updateable access through entity objects radio button within above radio button.
Click Next button. And then Step 2 of 7 page will appear as shown below.
Select EmployeeEO entity object and shuttle to next box. Ensure that there is no numeric in Alias
text box. If there is any then remove the numbers to follow proper naming convention.
Click next and new page (step 3 of 7) will appear. Select all the attributes from EmployeeEO and
shuttle to next box.
Click next button and page (Step 4 of 7) will appear. You can alter the settings of each of the
attribute. But for this exercise, keep this default.
Click next and below page (Step 5 of 7) will appear. As VO is based on EO, it will generate default
query and not modifiable until you check the checkbox Expert Mode. If you are modifying the
query with additional tables, where clauses or order by clauses, then make sure you click on Test
button. For this exercise, we will not modify anything on this page.
Click next button and page (Step 6 of 7) will appear. This page is again not much used and generally,
this page is being used to define the bind variables in VO. For this exercise, we will not modify
anything on this page.
Click next button and below page (Step 7 of 7) will appear. This page is to select which all java files to
generate for View Object. We will select View object class and View row class. VOImpl.java is
used to create rows, iterate rows and execute the query. VORowImpl.java is to get the handle of
row.
Click next and review page will appear. Once reviewed, click Finish button.
Click next and below page will appear. Select EmployeeVO and shuttle to next box. Ensure the
instance name is meaningful and doesnt contains any number. Hence give instance name as
EmployeeVO for our exercise.
Click next and below screen will appear. Do not select any AM and so click next.
In below page, select generate java files of Application module class. We need not generate
application module definition class. And so, click finish.
4. Create Attributesets file
In OA Components category, select package file and click ok (as shown below).
There will appear new dialog page as below. Enter Name as Attributesets and package as
oracle.apps.training.oaf.webui. Click ok button.
In structure window (below), right click on Attributesets > Click New > Click Attribute Set
Give the attribute set name as EmployeeId and select 2 properties: Prompt and Additional Text
and shuttle to next box. Click ok button, after that.
Then Select EmployeeId in structure window, and in Properties window enter the value of 2
properties:
Prompt: Employee ID
Property Value
ID PageLayoutRN
AM Definition oracle.apps.training.oaf.server.EmployeeAM
Window Title Training: Create Employee Page
Title Create an employee
Create new region inside PagelayoutRN by right clicking on PagelayoutRN > New > Region
Property Value
ID CreateEmpMesgCompRN
Region Style messageComponentLayout
Rows 10 (Give as per your requirements)
Columns 1 (Give as per your requirements)
Create new item under newly created CreateEmpMesgCompRN region by right clicking on
CreateEmpMesgCompRN> New > Item.
Property Value
ID EmployeeIdMTI
Item Style messageTextInput
Attribute Set /oracle/apps/training/oaf/webui/Attributesets/EmployeeId
View Instance EmployeeVO
View Attribute EmployeeId
Data Type NUMBER
Required Yes
Show Required True
Use the attribute set
Verify that prompt and additional text got automatically populated:
Same way create other items for different fields just one below another:
Title Field
Property Value
ID TitleMTI
Item Style messageTextInput
Attribute Set /oracle/apps/training/oaf/webui/Attributesets/Title
Maximum Length 30
View Instance EmployeeVO
View Attribute Title
Required Yes
Show Required True
Property Value
ID FirstNameMTI
Item Style messageTextInput
Attribute Set /oracle/apps/training/oaf/webui/Attributesets/FirstName
Maximum Length 20
View Instance EmployeeVO
View Attribute FirstName
Required Yes
Show Required True
Property Value
ID MiddleNameMTI
Item Style messageTextInput
Attribute Set /oracle/apps/training/oaf/webui/Attributesets/MiddleName
Maximum Length 60
View Instance EmployeeVO
View Attribute MiddleNames
Property Value
ID LastNameMTI
Item Style messageTextInput
Attribute Set /oracle/apps/training/oaf/webui/Attributesets/LastName
Maximum Length 40
View Instance EmployeeVO
View Attribute LastName
Required Yes
Show Required True
Property Value
ID FullNameMTI
Item Style messageTextInput
Attribute Set /oracle/apps/training/oaf/webui/Attributesets/FullName
Maximum Length 240
View Instance EmployeeVO
View Attribute FullName
Property Value
ID EmailAddressMTI
Item Style messageTextInput
Attribute Set /oracle/apps/training/oaf/webui/Attributesets/EmailAddress
Maximum Length 240
View Instance EmployeeVO
View Attribute EmailAddress
Position Code Field This will be messageChoice field. Follow the steps mentioned later in
this document.
Salary Field
Property Value
ID SalaryMTI
Item Style messageTextInput
Attribute Set /oracle/apps/training/oaf/webui/Attributesets/Salary
Data Type NUMBER
View Instance EmployeeVO
View Attribute Salary
Manager Name Field This field will be messageLovInput and steps are mentioned further
in this document.
Property Value
ID StartDateMTI
Item Style messageTextInput
Attribute Set /oracle/apps/training/oaf/webui/Attributesets/StartDate
Data Type DATE
View Instance EmployeeVO
View Attribute StartDate
Tip Type dateFormat
Required Yes
Show Required True
Right click on PageLayoutRN > New > Region and set below properties
Property Value
ID PageButtonBarRN
Region Style pageButtonBar
Once region has been created, right click on PageButtonBarRN and click New > Item and set
following properties of this item:
Property Value
ID SubmitBtn
Item Style submitButton
Prompt Submit
Create 2 methods in AMImpl.java
Select AM in applications navigator window > And then double click on EmployeeAMImpl.java in
Structure window:
EmployeeVOImpl vo = getEmployeeVO();
vo.setMaxFetchSize(0);
vo.insertRow(row);
row.setNewRowState(Row.STATUS_INITIALIZED);
} // end createEmployee()
getOADBTransaction().commit();
createEmployee();
}
Create new page controller and call above 2 methods from page controller
import java.io.Serializable;
import oracle.apps.fnd.common.MessageToken;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
super.processRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
am.invokeMethod("createEmployee");
super.processFormRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
if (pageContext.getParameter("SubmitBtn") != null)
pageContext.putDialogMessage(exc);
Property Value
ID PageStatusRN
Extends /oracle/apps/fnd/framework/webui/OAReqFieldDescRG
Horizontal Alignment Left
Create poplist VO for position codes
We will be creating position codes message choice which we left above in the document while
designing fields on the page.
To proceed, firstly we need to create VO which will based on query to fetch all available position
codes:
Right click on oracle.apps.training > New View Object and enter following data shown below:
Ensure that you select read only access radio button as this VO will not be based on entity object and
will be based on plain query.
Click next and enter the query to select position codes as shown below:
Test the query. And click next in all the further pages with no modifications and finally click on Finish
button.
Now we need to associate PositionsLovVO in new LovAM. Hence, right click on oracle.apps.training >
New Application Module
Click next and then select PositionsLovVO into next box without number characters:
And then click next in all the further pages without any changes. And finally, click on finish button.
Hence, Double click on EmployeeAM in Applications navigator window > It will popup application
module window > Click on application modules in left panel > Select LovAM from Available
application modules list box and shuttle to next list box (without number values appended). Then
click apply and ok button. Shown below:
Now we can define PositionsCode messageChoice in page. Hence Select CreateEmployeePG.xml and
in structure window > Right click CreateEmpMesgCompRN > New Item (Place this item between
Email address and salary by dragging item to salary field). Set below properties of this item:
Property Value
ID PositionCodeMC
Item Style messageChoice
Attribute Set /oracle/apps/training/oaf/webui/Attributesets/PositionCode
Picklist View Definition oracle.apps.training.lov.server.PositionsLovVO
Picklist View Instance PositionsLovVO
Picklist Display Attribute Meaning
Picklist Value Attribute LookupCode
View Instance EmployeeVO
View Attribute PositionCode
We will be creating manager namelist of values (LOV) which we left above in the document while
designing fields on the page.
Firstly, we need to create VO which will fetch all the managers. Follow the steps below to create
query based VO:
Right click on oracle.apps.training.lov.server > New View Object and enter following details:
Double click on LovAM in applications navigator window. In the new pop up window, select data
model in left panel, Select ManagersLovVO in Available view objects list box and shuttle to next list
box (without numbers) as shown below:
Now go back to CreateEmployeePG. Select CreateEmpMesgCompRN, right click on it > New > Item
(Place this new item between Salary and Start Date fields by dragging it on Start date field). Enter
following property values for this new item:
Property Value
ID ManagerIdLov
Item Style messageLovInput
Attribute Set /oracle/apps/training/oaf/webui/Attributesets/ManagerName
Search Allowed True
Selective Search Criteria True
Beneath above LOV, there will be another region created automatically with ID as region1 with
region style as listofValues. Change the property values for the same as:
Property Value
ID ManagerLovRN
Region Style listOfValues
AM Definition oracle.apps.training.lov.server.LovAM
Right click on above ManagerLovRN > New > table and set following properties for new table
Property Value
ID ManagerLovTbl
Region Style Table
Property Value
ID FirstNameLovMST
Item Style messageStyledText
Attribute Set /oracle/apps/training/oaf/webui/Attributesets/FirstName
Search Allowed True
Selective Search Criteria True
View Instance ManagersLovVO
View Attribute FirstName
Property Value
ID LastNameLovMST
Item Style messageStyledText
Attribute Set /oracle/apps/training/oaf/webui/Attributesets/LastName
Search Allowed True
Selective Search Criteria True
View Instance ManagersLovVO
View Attribute LastName
Property Value
ID FullNameLovMST
Item Style messageStyledText
Attribute Set /oracle/apps/training/oaf/webui/Attributesets/FullName
Search Allowed True
Sort Allowed True
Selective Search Criteria True
View Instance ManagersLovVO
View Attribute FullName
Property Value
ID ManagerIdLovFV
Item Style formValue
Attribute Set /oracle/apps/training/oaf/webui/Attributesets/EmployeeId
Data Type NUMBER
View Instance ManagersLovVO
View Attribute EmployeeId
Now also, create one form value field at messagecomponent layout level. Right click
CreateEmpMesgCompRN > New messageLayout and give its ID as FormValuesML
Right click FormValuesML > New > Item and set below properties:
Property Value
ID ManagerIdFV
Item Style formValue
Attribute Set /oracle/apps/training/oaf/webui/Attributesets/EmployeeId
Data Type NUMBER
View Instance EmployeeVO
View Attribute EmployeeId
Now navigate back to lovMappings located under ManagerIdLov. And define following mappings (to
define additional lov mapping, right click on lovMappings and click lovMap):
Property Value
ID FullNameLovMap
Lov Region Item FullNameLovMST
Return Item ManagerIdLov
Criteria Item ManagerIdLov
Property Value
ID ManagerIdLovMap
Lov Region Item ManagerIdLovFV
Return Item ManagerIdFV
Now we are good to run the CreateEmployeePG and on click of submit, we should be able insert the
record in employees table.
After entering all the details, and once clicked on submit, it will look like: