Professional Documents
Culture Documents
www.AppsLead.com
Oracle Applications Framework Business Cases
Best Blog :-
1- http://iwidi.org/index.php/oaf
4. Open JDeveloper and set database connection goto Connection Navigator > Database and
create a new connection
Note Give user name and password do not give any role and do not check Deploy
Password checkbox
Note Give Host Name, JDBC port, and SID. Keep driver as thin.
5. Create a sample workspace and project to know setting during creation of project
1. Goto Application Navigator right click > New > General > Workspace Configured
for Oracle Applications
Attribute Property
ID PageLayoutRN
AM Definition prajkumar.oracle.apps.ak.hello.server.HelloAM
Attribute Property
ID MainRN
Attribute Property
ID HelloName
Prompt Name
Length 20
Maximum Length 50
Attribute Property
ID ButtonLayout
Attribute Property
ID Go
Attribute /oracle/apps/fnd/attributesets/Buttons/Go
super.processFormRequest(pageContext, webBean);
if (pageContext.getParameter("Go") != null)
4. Create Test Table and insert data some data in it (For Testing Purpose)
CREATE TABLE xx_search_demo
( -- --------------------
-- Data Columns
-- --------------------
column1 VARCHAR2(100),
column2 VARCHAR2(100),
-- --------------------
-- Who Columns
-- --------------------
last_update_date DATE NOT NULL,
last_updated_by NUMBER NOT NULL,
creation_date DATE NOT NULL,
created_by NUMBER NOT NULL,
last_update_login NUMBER
);
INSERT INTO xx_search_demo VALUES („val1‟, ‟val2‟, SYSDATE, 0, SYSDATE, 0, 0);
INSERT INTO xx_search_demo VALUES („val1‟, ‟val2‟, SYSDATE, 0, SYSDATE, 0, 0);
INSERT INTO xx_search_demo VALUES („val3‟, ‟val4‟, SYSDATE, 0, SYSDATE, 0, 0);
INSERT INTO xx_search_demo VALUES („val5‟, ‟val6‟, SYSDATE, 0, SYSDATE, 0, 0);
Note – By default ROWID will be the primary key if we will not make any column to be
primary key Check the Accessors, Create Method, Validation Method and Remove Method
9. Select the SearchPG and go to the strcuture pane where a default region has been created
Note – DO NOT select Use this as Application Module Definition for this region checkbox
In Region Properties page, set Region ID value to ResultsTable and Region Style to table
In view Attributes page, select attributes from Available View Attributes list and shuttle
them to
Selected View Atributes list:
Column1
Column2
In Region Items Page, you can set ID, Style and Attributes Set. Currently we are going to set
only Style as messageStyledText
16. Congratulation you have successfully finished Search page. Run Your SearchPG page
and Test Your Work
4. Create Test Table and insert data some data in it (For Testing Purpose)
Note – By default ROWID will be the primary key if we will not make any column to be
primary key
Check the Accessors, Create Method, Validation Method and Remove Method
In Step2 in Entity Page select CustSearchEO and shuttle them to selected list
In Step3 in Attributes Window select columns Column1, Column2, Column3, Column4, and
shuttle them to selected list
In Java page deselect Generate Java file for View Object Class: CustSearchVOImpl and Select
Generate Java File for View Row Class: CustSearchVORowImpl
Select Right click on CustSearchAM > Application Modules > Data Model
Select CustSearchVO and shuttle to Data Model list
9. Select the CustSearchPG and go to the strcuture pane where a default region has been
created
In Step3 in View Attributes shuttle all the items (Column1, Column2, Column3, Column4)
available in “Available View Attributes” to Selected View Attributes:
In Step4 in Region Items page set style to “messageStyledText” for all items
13. Select CustSearchTable in Structure Panel and set property Width to 100%
15. Now right click on message Component Layout Region (SimpleSearchMappings) and
create two message text input beans and set the below properties to each
Message TextInputBean1
Id – SearchColumn1
Search Allowed – True
Data Type – VARCHAR2
Maximum Length –
CSS Class – OraFieldText
Prompt – Column1
Message TextInputBean2
Id – SearchColumn2
Search Allowed -- True
Data Type – VARCHAR2
Maximum Length – 100
CSS Class – OraFieldText
Prompt – Column2
16. Now Right Click on query Components and create simple Search Mappings. Then
automatically SimpleSearchMappings and QueryCriteriaMap1 created
17. Now select the QueryCriteriaMap1 and set the below properties
Id – SearchColumn1Map
Search Item – SearchColumn1
Result Item – Column1
18. Now again right click on simpleSearchMappings -> New -> queryCriteriaMap, and then
set the below properties
Id – SearchColumn2Map
Search Item – SearchColumn2
Result Item – Column2
19. Congratulation you have successfully finished Auto Customization Search page. Run
Your CustSearchPG page and Test Your Work
Add following Code in your Search page Controller where you have constructed your Query
Region
import oracle.apps.fnd.framework.webui.beans.layout.OAQueryBean;
...
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
OAQueryBean queryBean = (OAQueryBean)webBean.findChildRecursive("QueryRN");
// Here QueryRN is your Query Region Name as shown in following snap shot
queryBean.clearSearchPersistenceCache(pageContext);
}
Note –
After add this code, no need to worry about state of Application Module (AM). This code will
clean up result table automatically every time when you will open Search page first time and
when you are redirecting back to search page. But still as per good coding standard while
redirecting back to search page always keep AM state to FALSE
4. Create Test Table in which we will insert data (For Testing Purpose)
CREATE TABLE xx_insert_demo
( -- ---------------------
-- Data Columns
-- ---------------------
column1 VARCHAR2(100),
column2 VARCHAR2(100),
-- ---------------------
-- Who Columns
-- ---------------------
last_update_date DATE NOT NULL,
last_updated_by NUMBER NOT NULL,
creation_date DATE NOT NULL,
created_by NUMBER NOT NULL,
last_update_login NUMBER
);
Right click on InsertDemo > New > ADF Business Components > Entity Object
Name – InsertEO
Package -- prajkumar.oracle.apps.fnd.insertdemo.schema.server
Database Objects -- XX_INSERT_DEMO
Note – By default ROWID will be the primary key if we will not make any column to be
primary key.
Check the Accessors, Create Method, Validation Method and Remove Method
9. Select the InsertPG and go to the strcuture pane where a default region has been created
ID -- PageLayoutRN
Region Style -- PageLayout
AM Definition -- prajkumar.oracle.apps.fnd.insertdemo.server.InsertAM
Window Title -- Date Entry Page Window
Title -- Data Entry Page
Auto Footer -- True
if (!vo.isPreparedForExecution())
{
vo.executeQuery();
}
if (!pageContext.isFormSubmission())
{
OAApplicationModule am = pageContext.getApplicationModule(webBean);
am.invokeMethod("createRecord", null);
}
}
17. Add below method in InsertAMImpl Class to handle Apply Button action
import oracle.jbo.Transaction;
...
{super.processFormRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
if (pageContext.getParameter("Apply") != null)
{
OAViewObject vo = (OAViewObject)am.findViewObject("InsertVO1");
am.invokeMethod("apply");
pageContext.putDialogMessage(confirmMessage);
pageContext.forwardImmediately(
"OA.jsp?page=/prajkumar/oracle/apps/fnd/insertdemo/webui/InsertPG",
null, OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true, // retain AM
OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
19. Congratulations you have successfully created data insert page. Run InsertPG page to
test Your Work
1. Create a Search Page to Create a page please go through the following link
https://blogs.oracle.com/prajkumar/entry/create_oaf_search_page
Attribute Property
ID UpdateAction
Prompt Update
Height 24
Width 24
Event update
Submit True
4. Select the UpdatePG and go to the strcuture pane where a default region has been created
Attribute Property
ID PageLayoutRN
AM Definition prajkumar.oracle.apps.fnd.searchdemo.server.SearchAM
Attribute Property
ID Column1
Prompt Column1
Length 20
Attribute Property
ID Column2
Prompt Column2
Length 20
Attribute Property
Region ButtonLayout
Attribute Property
ID Apply
Attribute /oracle/apps/fnd/attributesets/Buttons/Apply
Attribute Property
ID Cancel
Attribute /oracle/apps/fnd/attributesets/Buttons/Cancel
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.webui.beans.layout.OAQueryBean;
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
OAQueryBean queryBean = (OAQueryBean)webBean.findChildRecursive("QueryRN");
queryBean.clearSearchPersistenceCache(pageContext);
}
if ("update".equals(pageContext.getParameter(EVENT_PARAM)))
{
pageContext.setForwardURL("OA.jsp?page=/prajkumar/oracle/apps/fnd/searchdemo/we
bui/UpdatePG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true,
OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
OAWebBeanConstants.IGNORE_MESSAGES);
}
}
13. Add Page Controller for UpdatePG
Right Click on PageLayoutRN of UpdatePG > Set New Controller
Name – UpdateCO
Package -- prajkumar.oracle.apps.fnd.searchdemo.webui
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.OAApplicationModule;
import java.io.Serializable;
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
String Column1 = pageContext.getParameter("PColumn1");
String Column2 = pageContext.getParameter("PColumn2");
Serializable[] params = { Column1, Column2 };
am.invokeMethod("updateRow", params);
}
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
if (pageContext.getParameter("Apply") != null)
{
am.invokeMethod("apply");
pageContext.forwardImmediately("OA.jsp?page=/prajkumar/oracle/apps/fnd/searchdem
o/webui/SearchPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
false, // retain AM
OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
}
else if (pageContext.getParameter("Cancel") != null)
{
am.invokeMethod("rollback");
pageContext.forwardImmediately("OA.jsp?page=/prajkumar/oracle/apps/fnd/searchdem
o/webui/SearchPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
false, // retain AM
OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
}
}
import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
import oracle.apps.fnd.framework.server.OAViewObjectImpl;
import oracle.apps.fnd.framework.server.OAViewObjectImpl;
16. Congratulation you have successfully finished. Run Your Search page and Test Your
Work
4. Create Test Table and insert data some data in it (For Testing Purpose)
CREATE TABLE xx_create_upd_demo
( -- ---------------------
-- Data Columns
-- ----------------------
column1 VARCHAR2(100),
column2 VARCHAR2(100),
column3 VARCHAR2(100),
column4 NUMBER,
-- ---------------------
-- Who Columns
-- ---------------------
last_update_date DATE NOT NULL,
last_updated_by NUMBER NOT NULL,
creation_date DATE NOT NULL,
created_by NUMBER NOT NULL,
last_update_login NUMBER
);
Note – By default ROWID will be the primary key if we will not make any column to be
primary key.
Check the Accessors, Create Method, Validation Method and Remove Method
9. Select the SearchPG and go to the strcuture pane where a default region has been created
16. Select the CreateUpdPG and go to the strcuture pane where a default region has been
created
ID – Column3
Style Property – messageTextInput
Prompt – Column3
Data Type – VARCHAR2
Length – 20
Maximum Length – 100
View Instance -- SearchVO1
View Attribute -- Column3
20. Add Controller for Page SearchPG Select PageLayoutRN right click Set New
Controller
Package Name -- prajkumar.oracle.apps.fnd.searchdemo.webui
import com.sun.java.util.collections.HashMap;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
if (pageContext.getParameter("Go") != null)
{
String userContent = pageContext.getParameter("MyId");
HashMap hmap = new HashMap();
hmap.put("MyId", userContent);
pageContext.setForwardURL(
"OA.jsp?page=/prajkumar/oracle/apps/fnd/searchdemo/webui/CreateUpdPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
hmap,
true,
OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
OAWebBeanConstants.IGNORE_MESSAGES);
}
}
Destination URI –
OA.jsp?page=/prajkumar/oracle/apps/fnd/searchdemo/webui/SearchPG&retainAM=Y
Text – Return to SearchPG
23. Add Controller for Page CreateUpdPG Select PageLayoutRN right click Set New
Controller
Package Name -- prajkumar.oracle.apps.fnd.searchdemo.webui
Class Name -- CreateUpdCO
Add Following code in that controller
import java.io.Serializable;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{ super.processRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
if (pageContext.getParameter("Apply") != null)
{ am.getTransaction().commit();
pageContext.setForwardURL(
"OA.jsp?page=/prajkumar/oracle/apps/fnd/searchdemo/webui/SearchPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true,
OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
OAWebBeanConstants.IGNORE_MESSAGES);
}
}
import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
import oracle.jbo.Row;
public void createRow(String Val)
{
SearchVOImpl vo = getSearchVO1();
vo.initQuery(Val);
vo.insertRow(studrow);
vo.setCurrentRow(studrow);
vo.getCurrentRow().setAttribute("Column4",Val);
studrow.setNewRowState(Row.STATUS_INITIALIZED);
}
}
}
import oracle.jbo.domain.Number;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.server.OAViewObjectImpl;
public void initQuery(String Val)
{
if ((Val != null) && (!("".equals(Val.trim()))))
{
// Do the following conversion for type consistency.
Number Val2 = null;
try
{
setWhereClause("Column4 = :1");
setWhereClauseParams(null); // Always reset
setWhereClauseParam(0, Val2);
executeQuery();
}
}
26. Congratulation you have successfully finished. Run Your SearcgPG page and Test Your
Work
Name – SearchCO
Package -- prajkumar.oracle.apps.fnd.searchdemo.webui
if ("delete".equals(pageContext.getParameter(EVENT_PARAM)))
{
String Column1 = (String)row.getAttribute("Column1");
String Column2 = (String)row.getAttribute("Column2");
String Column3 = pageContext.getParameter("Column1");
String Column4 = pageContext.getParameter("Column2");
MessageToken[] tokens = { new MessageToken("COLUMN1", Column1),
new MessageToken("COLUMN2", Column2)};
dialogPage.setOkButtonItemName("DeleteYesButton");
dialogPage.setOkButtonToPost(true);
dialogPage.setNoButtonToPost(true);
dialogPage.setPostToCallingPage(true);
dialogPage.setOkButtonLabel(yes);
dialogPage.setNoButtonLabel(no);
java.util.Hashtable formParams = new java.util.Hashtable(1);
formParams.put("Column1", Column3);
formParams.put("Column2", Column4);
dialogPage.setFormParameters(formParams);
pageContext.redirectToDialogPage(dialogPage);
}
OAApplicationModule am =
pageContext.getApplicationModule(webBean);
am.invokeMethod("deleteRecord", parameters);
OAException message = new OAException("FND",
"DELETE_CONFIRM", null,
OAException.CONFIRMATION, null);
pageContext.putDialogMessage(message);
}
8. Congratulation you have successfully finished. Run Your page and Test Your Work
3. We need two tables one table will be act as Master table and second table will be
act as Child or detail table. Lets Create two tables
-- Master Table
CREATE TABLE master_table_demo
( -- ---------------------
-- Data Columns
-- ---------------------
Column1 VARCHAR2(100),
Column2 VARCHAR2(100),
-- ----------------------
-- Who Columns
-- ----------------------
last_update_date DATE NOT NULL,
last_updated_by NUMBER NOT NULL,
creation_date DATE NOT NULL,
created_by NUMBER NOT NULL,
last_update_login NUMBER
);
-- Detail Table
CREATE TABLE detail_table_demo
( -- ---------------------
-- Data Columns
-- ---------------------
Column1 VARCHAR2(100),
Column2 VARCHAR2(100),
-- ----------------------
-- Who Columns
-- ----------------------
last_update_date DATE NOT NULL,
last_updated_by NUMBER NOT NULL,
creation_date DATE NOT NULL,
created_by NUMBER NOT NULL,
last_update_login NUMBER
);
Package -- prajkumar.oracle.apps.fnd.masterdetaildemo.schema.server
Database Objects -- master_table_demo
Check the Accessors, Create Method, Validation Method and Remove Method
Check the Accessors, Create Method, Validation Method and Remove Method
In Step3 in Attributes Window select columns Column1, Column2, DetailFlag and shuttle
them to selected list
In Java page deselect Generate Java file for View Object Class: MasterVOImpl
9. Create View Link Add Your View Object to Root UI Application Module
Right click on MasterDetailDemo > New > ADF Business Components > View Link
Name – MasterdetailDemoVL
Package -- prajkumar.oracle.apps.fnd.masterdetaildemo.server
12. Select MasterdetailDemoPG and go to the strcuture pane where a default region has
been created
Create Column2
Select MainTableRN > New > column
Create Column4
Select DetailTableRN > New > column
Select column4 > New > Item
ID – item4
Item Style – messageStyledText
View Instance – DetailVO2
View Attribute – Column2
20. Add Controller for Page MasterdetailDemoPG Select PageLayoutRN right click Set
New Controller
Package Name -- prajkumar.oracle.apps.fnd.masterdetaildemo.webui
Class Name -- MasterdetailDemoCO
Set Following Code in CO
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import prajkumar.oracle.apps.fnd.masterdetaildemo.server.MasterdetailDemoAMImpl;
...
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
MasterdetailDemoAMImpl AM =
(MasterdetailDemoAMImpl)pageContext.getApplicationModule(webBean);
pageContext.writeDiagnostics(this, "Calling Method", 1);
AM.MasterDetails(pageContext,webBean);
}
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
...
public void MasterDetails(OAPageContext pageContext,OAWebBean webBean)
{
23. Congratulation you have successfully finished. Run Your MasterdetailDemoPG page
and Test Your Work
Note - The VO is not based on any EO so click next and go to the query section and paste the
query
SELECT code_combination_id
FROM gl_code_combinations_kfv
In Step8 Check Object Class: KFFVOImpl -> Generate Java File -> Bind Variable Accessors
Name -- KFFPG
Package -- prajkumar.oracle.apps.fnd.kffdemo.webui
6. Select the KFFPG and go to the strcuture pane where a default region has been created
Attribute Property
ID PageLayoutRN
AM Definition prajkumar.oracle.apps.fnd.kffdemo.server.KFFAM
Attribute Property
ID MainRN
AM Definition stackLayout
9. Create a New Item of type Flex under the Stack Layout Region
Right click on MainRN > New > Item
Set Following Properties for New Item --
Attribute Property
ID KeyFlexItem
Name GL#
Type Key
OAKeyFlexBean kffId =
(OAKeyFlexBean)webBean.findIndexedChildRecursive("KeyFlexItem");
if(!vo.isPreparedForExecution())
{
vo.executeQuery();
}
}
Note -- If you do not want to see the key flex field is merging one then change the code in
the controller class as below
kffId.useCodeCombinationLOV(false);
SELECT fif.application_id,
fif.id_flex_code,
fif.id_flex_name,
fif.application_table_name,
fif.description,
fifs.id_flex_num,
fifs.id_flex_structure_code,
fifse.segment_name,
fifse.segment_num,
fifse.flex_value_set_id
FROM fnd_id_flexs fif,
fnd_id_flex_structures fifs,
fnd_id_flex_segments fifse
WHERE fif.application_id = fifs.application_id
AND fif.id_flex_code = fifs.id_flex_code
AND fifse.application_id = fif.application_id
AND fifse.id_flex_code = fif.id_flex_code
AND fifse.id_flex_num = fifs.id_flex_num
AND fif.id_flex_code LIKE 'GL#'
AND fif.id_flex_name LIKE 'Accounting Flexfield';
12. Congratulation you have successfully finished. Run Your page and Test Your Work
Right Click on DependentLovDemo > Oracle Applications > Run Options. Check OADeveloperMode should not be
inSelected Options if it is there in Selected Options list then shuttle it back to Available Options
Note - The VO is not based on any EO so click next and go to the query section and paste the
query
Note - The VO is not based on any EO so click next and go to the query section and paste the
query
Scope -- Public
Note - The property Scope is the key property which makes the LOV region public and makes
it usable in multiple pages
7. Right click on FirstLovRN and click table using wizard. In the wizard choose the
prajkumar.oracle.apps.fnd.dependentlovdemo.server.DependentLovAM and select
DependentLovVO1_1. Click Next
Region Id – FirstLovRN
Region style – table
8. Shuttle the two attributes to the right side.That is PersonId and FullName
Attribute Property
Attribute Property
Note - The property Scope is the key property which makes the LOV region public and makes
it usable in multiple pages
14. Right click on SecondLovRN and click table using wizard. In the wizard choose the
prajkumar.oracle.apps.fnd.dependentlovdemo.server.DependentLovAM and select
DependentLovVO2_1. Click Next
Region Id – SecondLovRN
Region style – table
15. Shuttle the two attributes to the right side.That is PersonId and FullName
Attribute Property
Attribute Property
Attribute Property
Name DependentLovPG
Package prajkumar.oracle.apps.fnd.dependentlovdemo.webui
21. Select the DependentLovPG and go to the strcuture pane where a default region has
been created
Attribute Property
ID PageLayoutRN
AM prajkumar.oracle.apps.fnd.dependentlovdemo.server.DependentLovAM
Definition
Attribute Property
ID MainRN
24. Create a New item to store Return result of First LOV and to give Search Criteria to
second LOV
Select PageLayoutRN > New > Item
Set following Properties for New Item –
Attribute Property
ID ParentPersonId
Attribute Property
ID Employee_Name
Attribute Property
Attribute Property
Attribute Property
ID Dependent_Name
Attribute Property
Attribute Property
Required True
27. Congratulation you have successfully finished. Run Your page and Test Your Work
Note - The VO is not based on any EO so click next and go to the query section and paste the
query
SELECT employee_number, full_name
FROM per_all_people_f
WHERE SYSDATE BETWEEN effective_start_date AND effective_end_date
6. Select the LovPG and go to the strcuture pane where a default region has been created
Note - The property Scope is the key property which makes the LOV region public and makes
it usable in multiple pages
10. Select EmployeeLovRN. Right click on EmployeeLovRN in Structure pane and click
table using wizard. In the wizard choose the
prajkumar.oracle.apps.fnd.lovdemo.server.LovAM and select the LovVO1. Click Next
Region Id -- LovRN
Region style -- table
11. Shuttle the two attributes to the right side.That is EmployeeNumber and FullName
13. Select the field FullName and set the following properties:
Search Allowed -- True
Selective Search Criteria – True
Note - The first property lets users search on these values in the LOV, and the second
property ensures that the users specify search criteria for at least one of these values to avoid a
blind query
14. Click on LovPG and right click the MainRN and click new messageLovInput
External Lov -- /prajkumar/oracle/apps/fnd/lovdemo/webui/EmployeeLovRN
Lov Region Item -- FullName
Return Item -- item1
Criteria Item -- item1
Prompt -- Employee Name
15. Congratulation you have successfully finished. Run Your page and Test Your Work
4. Select SetDefaultPG and go to the strcuture pane where a default region has been
created
Attribute Property
ID PageLayoutRN
AM Definition prajkumar.oracle.apps.fnd.setdefaultproj.SetDefaultAM
Attribute Property
ID MainRN
7. Create messageTextInput
MainRN > New > messageTextInput
Attribute Property
ID MyTextitemId
Length 20
Maximum Length 50
9. Add a Controller
MainRN > Set New Controller
import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
String myValue = "My Default Value";
OAMessageTextInputBean textBean =
(OAMessageTextInputBean)webBean.findChildRecursive("MyTextitemId");
textBean.setValue(pageContext, myValue);
}
5. Select the poplistdemoPG and go to the strcuture pane where a default region has been
created
10. Congratulation you have successfully finished. Run Your page and Test Your Work
In Attribute Page
Click on New button and create transient primary key attribute with the following properties:
Attribute Property
Name RowKey
Type Number
Updateable Always
Click New button again and create transient attribute with the following properties:
Attribute Property
Name TextItem2Render
Type Boolean
Updateable Always
Attribute Property
ID PageLayoutRN
AM Definition prajkumar.oracle.apps.fnd.pprdemo.server.PPRAM
Attribute Property
ID MainRN
Attribute Property
ID TextItem1
Length 20
Event TextItem1Change
Submit True
Note -- Disable Client Side Validation and Event property appears after you set the Action
Type property to firePartialAction
Attribute Property
ID TextItem2
Length 20
Rendered ${oa.PPRVO1.TextItem2Render}
import oracle.apps.fnd.framework.OARow;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
import oracle.apps.fnd.framework.server.OAViewObjectImpl;
public void handlePPRAction()
{
Number val = 1;
OAViewObject vo = (OAViewObject)findViewObject("PPRVO1");
if (vo != null)
{
if (vo.getFetchedRowCount() == 0)
{
vo.setMaxFetchSize(0);
vo.executeQuery();
vo.insertRow(vo.createRow());
OARow row = (OARow)vo.first();
row.setAttribute("RowKey", val);
row.setAttribute("TextItem2Render", Boolean.FALSE);
}
}
}
import oracle.apps.fnd.framework.OARow;
import oracle.apps.fnd.framework.OAViewObject;
am.invokeMethod("handlePPRAction");
}
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
PPRAMImpl am = (PPRAMImpl)pageContext.getApplicationModule(webBean);
OAViewObject vo = (OAViewObject)am.findViewObject("PPRVO1");
OARow row = (OARow)vo.getCurrentRow();
if ("TextItem1Change".equals(pageContext.getParameter(EVENT_PARAM)))
{
if (pageContext.getParameter("TextItem1").equals(""))
{
row.setAttribute("TextItem2Render", Boolean.FALSE);
}
else
{
row.setAttribute("TextItem2Render", Boolean.TRUE);
}
}
}
11. Congratulation you have successfully finished. Run Your PPRPG page and Test Your
Work
Create item1
Select MainRN > New > messageTextInput
Set following Properties for Text Item1
ID – item1
Item Style – messageTextInput
Data Type -- Number
Prompt – Text Item1
Maximum Length – 20
Length -- 20
Create item2
Select MainRN > New > messageTextInput
Set following Properties for Text Item1
ID – item2
Item Style – messageTextInput
Data Type -- Number
Prompt – Text Item2
Maximum Length – 20
Length -- 20
Select newly created messageLayout right click > New > item
Set Following Properties for newly created item
ID – Sum
Item Style – submitButton
Attribute Set -- /oracle/apps/fnd/attributesets/Buttons/Go
Prompt – Sum
9. Let us create a package and package body which we will call from OAF page
This Package takes three parameters all are number. First two are IN parameters and last is
OUT as sum of first two numbers
Package Spec
EXIT;
Package Body
import oracle.apps.fnd.framework.server.OADBTransaction;
import oracle.apps.fnd.framework.server.OADBTransactionImpl;
import oracle.jdbc.OracleCallableStatement;
import java.sql.Types;
import oracle.apps.fnd.framework.OAException;
...
public String dataSumAction(String item1,String item2)
{ OADBTransaction oadbtransaction = (OADBTransaction)getTransaction();
OADBTransactionImpl oadbtransactionimpl = (OADBTransactionImpl)getTransaction();
String retValues;
StringBuffer str = new StringBuffer();
str.append( " BEGIN ");
str.append( " test_package.data_sum( ");
str.append( " item1 => :1, ");
str.append( " item2 => :2, ");
str.append( " data_sum => :3 ");
str.append( " ); ");
str.append( " END; ");
OracleCallableStatement oraclecallablestatement =
(OracleCallableStatement)oadbtransaction.createCallableStatement(str.toString(), 1);
try{
oraclecallablestatement.setInt(1, Integer.parseInt(item1) );
oraclecallablestatement.setInt(2, Integer.parseInt(item2) );
oraclecallablestatement.registerOutParameter(3, Types.VARCHAR);
oraclecallablestatement.execute();
retValues = oraclecallablestatement.getString(3);
}
catch(Exception e)
{
throw OAException.wrapperException(e);
}
return retValues;
}
11. Add Controller for Page ParameterizedProcDemoPG Select PageLayoutRN right click
Set New Controller
Package Name -- prajkumar.oracle.apps.fnd.parameterizedprocdemo.webui
Class Name -- ParameterizedProcDemoCO
Add Following Code in Controller
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.OAApplicationModule;
import java.io.Serializable;
...
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
if (pageContext.getParameter("Sum") != null)
{
Serializable[] parameters1 = { pageContext.getParameter("item1"),
pageContext.getParameter("item2"),
};
Attribute Property
ID PageLayoutRN
AM Definition prajkumar.oracle.apps.fnd.traindemo.server.TrainDemoAM
Attribute Property
ID MainRN
Create Text Items for all three pages say TextItemPage1, TextItemPage2 and TextItemPage3
in respective pages TrainDemoPG1, TrainDemoPG2 and TrainDemoPG3 in similar way of
as mention below to create TextItemPage1 in page TrainDemoPG1
6. Create Text Items
Select MainRN right click > New > messageTextInput
Prompt – TextItemPage1
Length -- 20
Name -- TrainFooterRN
Package -- prajkumar.oracle.apps.fnd.traindemo.webui
Region Style -- pageButtonBar
import oracle.apps.fnd.framework.webui.beans.nav.OATrainBean;
import oracle.apps.fnd.framework.webui.beans.nav.OANavigationBarBean;
...
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
OATrainBean trainBean =
(OATrainBean)pageContext.getPageLayoutBean().getLocation();
trainBean.prepareForRendering(pageContext);
Style -- pageButtonBar
Extends -- /prajkumar/oracle/apps/fnd/traindemo/webui/TrainFooterRN
15. Congratulation you have successfully finished. Run Your TrainDemoPG1 page and Test
Your Work
Step 1
Create a new Workspace and a new Project as dictated by Oracle's tutorial. When
defining project, you will specify a default package, which in this case was
oracle.apps.ak.hello
This means the following: -
[means fnd_applications.short_name]
Step 2
Next, you will create a OA Page within hello project
Think OA Page as the fmx file itself in D2K. I am saying so because this page gets
attached to the form function.
This page will be created within hello project, hence the package
nameoracle.apps.ak.hello.webui
Note the webui, it is a convention to have page in webui, means this page
represents the Web User Interface
You will assign the default AM [OAApplicationModule]. Think of AM
"Connection Manager" and "Transaction State Manager" for your page
OAMessageTextInputBean field
HelloName =
(OAMessageTextInputBean)webBean.findChildRecursive("HelloName");
fieldHelloName.setText(pageContext,"Setting the default value" );
In D2k, your Forms fmb file was compiled to fmx. It was fmx file that was deployed
on mid-tier. In case of OAF, your OA Page is nothing but a XML file. We call this MDS
[meta data].
Whatever name you give to "Page" in OAF, an XML file of the same name gets
created. This xml file must then be loaded into database by using XML Importer
command.
Note 3
Apart from MDS XML file, almost everything else is merely deployed to your mid-
tier. Usually this is underneath $JAVA_TOP/oracle/apps/../..
All java files will go underneath java top/oracle/apps/../.. etc.
Note 4
When building tutorial, ignore the steps for setting "Attribute Sets". These are not
mandatory. Oracle might just have developed their tutorials without including these.
Think of these like Visual Attributes of D2K forms
Note 5
Controller is where you will write any java code in OA Framework. You can create a
Controller per Page or have a different Controller for each of the Regions with the
same Page.
Note 6
In the method processFormRequest of the Controller, you can access the values of the
page by using notation pageContext.getParameter("<fieldname here>").
This method processFormRequest is executed when the OAF Screen/Page is
submitted by click of a button.
Note 7
Inside the controller, all the Database Related interactions for example interaction
with View Objects happen via Application Module.
But why so? Because Application Module Manages the transaction state of the
Application.
OAApplicationModuleImpl oaapplicationmoduleimpl =
OAApplicationModuleImpl)oapagecontext.getApplicationModule(oawebbean);
OADBTransaction oadbtransaction =
OADBTransaction)oaapplicationmoduleimpl.getDBTransaction();
Note 8
In D2K, we have control block or a block based on database view. Similarly, in OA
Framework, if the field does not have view Object attached, then it is like a control
field. Hence in HelloWorld example, field HelloName is a control field [in D2K
terminology]. A view Object can either be based on a view/table, synonym or on a
SQL statement.
Note 9
I wish to access the fields in multi record block that is based on view Object. Can I do
this in Controller?
Sure you can. To traverse through those records, do the below
Get the reference to the View Object using
(OAViewObject)oapagecontext.getApplicationModule(oawebbean).findViewObject("
VO Name Here")
Loop through the records in View Objects using count returned from
oaviewobject.getFetchedRowCount()
For each record, fetch the value of the fields within the loop as
oracle.jbo.Row row = oaviewobject.getRowAtRangeIndex(loop index here);
(String)row.getAttribute("Column name of VO here ");
Attribute Property
ID PageLayoutRN
AM Definition prajkumar.oracle.apps.fnd.Calld2kformfromOAF.server.
Calld2kformfromOAFAM
Attribute Property
ID MainRN
Attribute Property
Region ButtonLayout
Attribute Property
ID Go
9. Add a Controller
Select MainRN right click > Set New Controller
Package Name -- prajkumar.oracle.apps.fnd.Calld2kformfromOAF.webui
Class Name -- Calld2kformfromOAFCO
String destination =
"form:FND:APPLICATION_DEVELOPER:STANDARD:FND_FNDPOMPO";
pageContext.forwardImmediatelyToForm(destination);
}
}
11. Congratulation you have successfully finished. Run Your page and Test Your Work
DECLARE
BEGIN
fnd_function.execute
( FUNCTION_NAME =>'CALL_OAF_FROM_D2K',
OPEN_FLAG =>'Y',
SESSION_FLAG =>'Y',
OTHER_PARAMS =>'FIRSTNAME=' ||
:CALLOAFFROMD2KBLOCK.FIRST_NAME || '&LASTNAME=' ||
:CALLOAFFROMD2KBLOCK.LAST_NAME
);
END;
import oracle.apps.fnd.framework.OAException;
...
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{ super.processFormRequest(pageContext, webBean);
10. Congratulation you have successfully finished. Run Form and Test Your Work
Attribute Property
ID PageLayoutRN
AM Definition prajkumar.oracle.apps.fnd.hostandurl.server.HostandURLAM
Attribute Property
ID MainRN
Attribute Property
Region ButtonLayout
Attribute Property
ID Go
9. Add a Controller
Select MainRN right click > Set New Controller
Package Name -- prajkumar.oracle.apps.fnd.hostandurl.webui
Class Name -- HostandURLCO
import java.net.*;
import java.io.*;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.webui.OAPageContext;
public void processFormRequest(OAPageContext pageContext, OAWebBean
webBean)
{
super.processFormRequest(pageContext, webBean);
if (pageContext.getParameter("Go") != null)
{
// To get Host Name
try
{
InetAddress addr = InetAddress.getLocalHost();
byte[ ] ipAddr = addr.getAddress();
String hostname = "Host Name: " +addr.getHostName();
pageContext.putDialogMessage(new OAException(hostname,
OAException.WARNING));
}
catch (UnknownHostException e)
{
}
// To Get Page URL
pageContext.putDialogMessage(new OAException(pageURL,
OAException.WARNING));
}
}
11. Congratulation you have successfully finished. Run Your page and Test Your Work
4. Select the FileUploadPG and go to the strcuture pane where a default region has been
created
Attribute Property
ID PageLayoutRN
AM Definition prajkumar.oracle.apps.fnd.fileuploaddemo.server.FileUploadAM
Window Title Uploading File into Server from Local Machine Demo Window
Attribute Property
ID MainRN
Attribute Property
ID MessageFileUpload
Attribute Property
ID ButtonLayout
Attribute Property
ID Submit
CODE #1 -- If Page has not deployed at instance, testing at Local Machine, use following
Code
public void upLoadFile(OAPageContext pageContext,OAWebBean webBean)
{ String filePath = "D:\\PRajkumar";
System.out.println("Default File Path---->"+filePath);
String fileUrl = null;
try
{
{
DataObject fileUploadData = pageContext.getNamedDataObject("MessageFileUpload");
//FileUploading is my MessageFileUpload Bean Id
if(fileUploadData!=null)
{
String uFileName = (String)fileUploadData.selectValue(null, "UPLOAD_FILE_NAME");
String contentType = (String) fileUploadData.selectValue(null,
"UPLOAD_FILE_MIME_TYPE");
System.out.println("User File Name---->"+uFileName);
FileOutputStream output = null;
InputStream input = null;
BlobDomain uploadedByteStream = (BlobDomain)fileUploadData.selectValue(null,
uFileName);
System.out.println("uploadedByteStream---->"+uploadedByteStream);
10. Congratulation you have successfully finished. Run Your page and Test Your Work
Click here to know Steps to Add JAR file into R12 server in OA
-- Data Columns
-- --------------------
column1 VARCHAR2(100),
column2 VARCHAR2(100),
column3 VARCHAR2(100),
column4 VARCHAR2(100),
column5 VARCHAR2(100),
-- --------------------
-- Who Columns
-- --------------------
last_update_date DATE NOT NULL,
last_updated_by NUMBER NOT NULL,
creation_date DATE NOT NULL,
created_by NUMBER NOT NULL,
last_update_login NUMBER
);
Note – By default ROWID will be the primary key if we will not make any column to be
primary key
Check the Accessors, Create Method, Validation Method and Remove Method
In Java page Uncheck Generate Java file for View Object Class: ImportxlsVOImpl
Select Generate Java File for View Row Class: ImportxlsVORowImpl -> Generate Java File ->
Accessors
9. Select the ImportxlsPG and go to the strcuture pane where a default region has been
created
Attribute Property
ID PageLayoutRN
AM Definition prajkumar.oracle.apps.fnd.importxlsdemo.server.ImportxlsAM
Window Title Import Data From Excel through OAF Page Demo Window
Attribute Property
ID MainRN
Attribute Property
ID MessageFileUpload
Attribute Property
ID ButtonLayout
Attribute Property
ID Go
try
{
fileName = (String)fileUploadData.selectValue(null, "UPLOAD_FILE_NAME");
}
catch(NullPointerException ex)
{
throw new OAException("Please Select a File to Upload", OAException.ERROR);
}
BlobDomain uploadedByteStream = (BlobDomain)fileUploadData.selectValue(null,
fileName);
try
{
OAApplicationModule oaapplicationmodule = pageContext.getRootApplicationModule();
Serializable aserializable2[] = {uploadedByteStream};
Class aclass2[] = {BlobDomain.class };
oaapplicationmodule.invokeMethod("ReadExcel", aserializable2,aclass2);
}
catch (Exception ex)
{
throw new OAException(ex.toString(), OAException.ERROR);
}
}
if (!vo.isPreparedForExecution())
{
vo.executeQuery();
}
try
{
w = Workbook.getWorkbook(inputWorkbook);
catch (BiffException e)
{
e.printStackTrace();
}
}
15. Congratulation you have successfully finished. Run Your page and Test Your Work
2. ooxml-schemas-1.1.jar
http://mvnrepository.com/artifact/org.apache.poi/ooxml-schemas/1.1
3. stax-api-1.0.1.jar
http://www.jarfinder.com/index.php/jars/versionInfo/69009
4. log4j-1.2.16.jar
http://mvnrepository.com/artifact/log4j/log4j/1.2.16
5. poi-ooxml-schemas-3.7.jar
http://mavenhub.com/mvn/central/org.apache.poi/poi-ooxml-schemas/3.7
6. poi-3.7-20101029.jar
http://mvnrepository.com/artifact/org.apache.poi/poi/3.7-beta1
7. xmlbeans-2.4.0.jar
http://www.jarfinder.com/index.php/jars/versionInfo/14387
8. dom4j-1.6.1.jar
http://grepcode.com/snapshot/repo1.maven.org/maven2/dom4j/dom4j/1.6.1
Click here to know Steps to Add JAR file into R12 server in OA
4. Create Test Table in which we will insert data from *.xlsx file
CREATE TABLE xx_import_excel_data_demo
( -- --------------------
-- Data Columns
-- --------------------
column1 VARCHAR2(100),
column2 VARCHAR2(100),
column3 VARCHAR2(100),
column4 VARCHAR2(100),
column5 VARCHAR2(100),
-- --------------------
-- Who Columns
-- --------------------
last_update_date DATE NOT NULL,
last_updated_by NUMBER NOT NULL,
creation_date DATE NOT NULL,
created_by NUMBER NOT NULL,
last_update_login NUMBER
);
Note – By default ROWID will be the primary key if we will not make any column to be
primary key
Check the Accessors, Create Method, Validation Method and Remove Method
In Java page
Select Generate Java File for View Object Class: ImportxlsVOImpl -> Generate Java File ->
Bind Variable Accessors
Select Generate Java File for View Row Class: ImportxlsVORowImpl -> Generate Java File ->
Accessors
9. Select the ImportxlsPG and go to the strcuture pane where a default region has been
created
Attribute Property
ID PageLayoutRN
AM Definition prajkumar.oracle.apps.fnd.importxlsdemo.server.ImportxlsAM
Window Title Import Data From Excel(*.xlsx) through OAF Page Demo
Window
Attribute Property
ID MainRN
Attribute Property
ID MessageFileUpload
Attribute Property
ID ButtonLayout
Attribute Property
ID Go
}
catch (Exception ex)
{
throw new OAException(ex.toString(), OAException.ERROR);
}
}
}
try
{
colCounts = row.getLastCellNum();
}
catch (NullPointerException e)
{
colCounts=1;
}
String[] excel_data = new String[colCounts+1];
default:
excel_data[j] = "";
}
}
catch (NullPointerException e)
{
excel_data[j] = "";
}
}
createRecord(excel_data);
}
}
catch (IOException e)
{
e.printStackTrace();
}
}
15. Congratulation you have successfully finished. Run Your page and Test Your Work
Category: Oracle
Tags: importing_data_from_xlsx_sheet
Example –
DECLARE
BEGIN
jdr_utils.printDocument('/prajkumar/oracle/apps/fnd/webui/HelloWorldPG',1000);
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;
sh $INST_TOP/admin/scripts/adoacorectl.sh stop
Start Server
sh $INST_TOP/admin/scripts/adoacorectl.sh start
sh $COMMON_TOP/admin/scripts/KTPLDEV_trishul/adapcctl.sh stop
Start Server
sh $COMMON_TOP/admin/scripts/KTPLDEV_trishul/adapcctl.sh start
Now for knowing which controller to extend we click on "About This Page" Link and select
Expand All. Here we can see the Name of the controller that we need to extend
Note -- Give the Name of your Extended Class give its package path and in the extends
property select base class
import prajkumar.oracle.apps.fnd.searchdemo.webui.SearchCO;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.webui.beans.layout.OAQueryBean;
import prajkumar.oracle.apps.fnd.searchdemo.server.SearchVOImpl;
//Capturing Go Button ID
String go = queryBean.getGoButtonName();
//If its Not NULL which mean user has pressed "Go" Button
if(pageContext.getParameter(go)!=null)
{
// Setting whereClause at Runtime to restrict the query
SearchVOImpl vo = (SearchVOImpl)am.findViewObject("SearchVO1");
vo.setWhereClause(null);
vo.setWhereClause("Column1 <>:1 AND Column2 <>:2");
vo.setWhereClauseParam(0,"val5");
vo.setWhereClauseParam(1,"val6");
}
}
}
Note -- If you are not able to see this link then go through below link –
https://blogs.oracle.com/prajkumar/entry/how_to_enable_personalization_link
Click on Complete View -> Expand All -> Click on personalize icon next to Page Layout
Now at site level give the path of extended controller as we are extending the controller
atSITE LEVEL
prajkumar.oracle.apps.fnd.coextensiondemo.webui.ExtendedCO
5. Congratulation you have successfully finished. Run Your SearchPG page and Test Your
Work
Click Go
Note – Record with Column1 value val5 and Column2 value val6 is not coming in result
Package -- prajkumar.oracle.apps.fnd.insertdemo.server
Name -- ExtendedAM
Extends -- prajkumar.oracle.apps.fnd.insertdemo.server.InsertAM
stmt.setInt(1, getOADBTransaction().getUserId());
stmt.setString(2, getOADBTransaction().getUserName());
stmt.setDate(3, d);
stmt.setInt(4, getOADBTransaction().getUserId());
stmt.setDate(5, d);
stmt.setInt(6, getOADBTransaction().getUserId());
stmt.setInt(7, getOADBTransaction().getUserId());
stmt.execute();
}
catch(Exception exception)
{
throw new OAException("Error in Staffing Query"+exception, OAException.ERROR);
}
super.apply();
}
}
2. Perform AM Substitution
Double Click on InsertDemo.jpx
Business Components > Substitutions
5. Congratulation you have successfully finished. Run Your InsertPG page and Test Your
Work
Here we can see that results table has SearchVO attached to it. Now click on Business
Component Reference details and check the path of SearchVO
Now click on SearchVO which is an EO based [SearchEO] to check whether it has Creation
Date attribute or not which we want to add
Here we can see that our VO does not have CreationDate attribute.
So for adding this attribute we need to perform VO Extension.
FTP this project from application server and open in JDeveloper
Extends -- prajkumar.oracle.apps.fnd.searchdemo.server.SearchVO
The next screen allows the addition or deletion of Entity Objects. No change is required here
for this extension so simply select Next
The next pane allows additional attributes to be added or attributes to be removed. In this
case add CreationDate attributes to the selected list
Note -- Please note the new attribute you would be adding will be coming as Transient
Modify above SQL statement with below SQL to add new attribute CREATION_DATE
SELECT SearchEO.COLUMN1,
SearchEO.COLUMN2,
SearchEO.ROWID,
SearchEO.CREATION_DATE
FROM XX_SEARCH_DEMO SearchEO
Click Finish
Note -- Now as our attribute created as Transient hence to fix this issue we have two options:
1. We need to correct our XML file generated as it is a known error with Jdeveloper
2. Double click on that attribute i.e CreationDate and in the View Object Attribute window,
enter attribute name in 'Expression' column i.e. CreationDate
with
6. Congratulation you have successfully finished. Run Your SearchPG page and Test Your
Work
Note -- You can notice page has new Column with name Creation Date
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.
Name – ExtInsertEO
Package -- prajkumar.oracle.apps.fnd.insertdemo.schema.server
Extends -- prajkumar.oracle.apps.fnd.insertdemo.schema.server.InsertEO
import oracle.apps.fnd.framework.OAException;
8. Congratulation you have successfully finished. Run Your InsertPG page and Test Your
Work
Fetch Profile Value : Fetching the values like profile , orgId, testFunction
etc can be done in two ways.
1. Fetching it from pageContext.
Syntax : pageContext.getProfile(„XXWHO_ENTITY‟);
2. Write a VO to query the values directly from the data base.
Syntax: SELECT FND_PROFILE.VALUE(‘XXWHO_ENTITY’) FROM DUAL
The first option brings the data from the cache, so it takes time for the
changed values to be reflected in front-end. But the second option is costly
performance wise. So its better to invalidate cache regularly and use the first
option to fetch such kind of values.
If you want any values of your CO to be available in your EO, put those
values in transaction. Do this only if it is very much required. Should not
create unnecessary transactions anywhere. Only get the already existing
transaction object from AM using getTransaction() Method.
Passing too many parameters through hashmap not only effects the
performance but it also effects the UI
Avoid writing huge code in CO. No business logic should be written in the
CO or AM. Try creating private methods in controller wherever you have
redundant code.
Create separate interface per module for declaring all your constant variables
rather than hardcoding the values in the code.
Ex : You want to use a lookup name n number of times in your coding.
Instead of hardcoding it everywhere, declare it in your constants interface and
use the constant in your code. Tomorrow, If you have to change the lookup,
you can change it at a single place (in the constants interface) and save time.
HGrid cache: Hgrid is one of the components in OAF which gives major
surprises to the developer everytime. Should be very careful while creating
the viewlink. Remember to clear the cache of the hgrid each time the hgrid is
rendered or the hgrid query is executed.
Syntax : hgridBean.clearCache();
To expand the hgrid upto nth level by default (i.e to expand the tree structure
upto nth child), use the following syntax :
hgridBean.setAutoExpansionMaxLevels(n);
Better to call sequences from the create method of EO rather than calling
them from custom methods in AM. Infact, set all the default values or who
columns for attributes here only.
Always reset a VO before iterating it. Especially when getting the values of a
radio button selection etc.
Ex :
vo.reset();
while(vo.hasNext()){
// get handle of the vo‟s current row and perform ur operations;
// break the loop after reaching the last record of the current rowset.
}
Set any VO‟s where clause and where clause params in VOImpl class rather
than creating directly in CO. This increases reusability and modularity. But
you don‟t have to set any where clause or where clause params and should
directly execute the query, then need not use VOImpl for calling the
executeQuery() method.
try{
throw new OAException(“APP_CODE”, “ERROR_MSG”);
}catch(Exception _exception) {
throw OAException.wrapperException(_exception);
}
Use the following syntax for logging your exception in the log file
if(pageContext.isLoggingEnabled(4)) {
pageContext.writeDiagnostics(getClass().getName()+”.processFormReque
st”, “Exception Details : “, 4);
}
Do not catch your exceptions wherever they occurred (ex in AM). The
exception must always be thrown back to the calling method . So all the
exceptions must be finally caught in the CO.
applicable regions.
Construction Modes:
There are three construction modes available. In the above example we have
used ‘resultBasedSearch’construction mode. Here is a brief comparison of the three modes.
1] resultsBasedSearch:
OA Framework automatically renders both the Simple and Advanced search regions based on the
designated queryable items in the associated table.
The search regions automatically include both a Go and a Clear button.
OA Framework automatically executes the underlying search when the user selects the Go button.
2] autoCustomizationCriteria:
OA Framework automatically renders both the Simple and Advanced search regions based on the
corresponding Simple search and Advanced search regions that you define and specify as named
children of the query region.
The search regions automatically include a Go button. In addition, the Advanced search region includes a
Clear button.
OA Framework automatically executes the underlying search when the user selects the Go button.
However, developers must explicitly define mappings between items in the Search panel and items in the
table region.
3] none
The Search regions are rendered based on the Simple Search and Advanced Search regions that you
define and specify as named children of the query region.
You must implement your own Go button in this mode.
The underlying search must be executed by the developer.
You can use OAException (or any of its subclasses) to display a message on an OA Framework page and the OA
Framework automatically displays an error message at the top of the current page.
You can display the following standard kinds of messages at the top of a page:
Error
Warning
Confirmation
Information
You can explicitly display a message box of any type using the following code in your controller.
If — after you call putDialogMessage() in your processFormRequest() method — you want to forward to the current
page or another page and display the message at the top of the new target page, you need to call the appropriate
oracle.apps.fnd.framework.webui.OAPageContext forwardImmediately*() method. The OA Framework immediately
stops processing the page and issues a forward before displaying the messages.
You can register or throw multiple exceptions; the OA Framework combines them into a single message box using
the following rules:
Since an error is more important than a warning, the message box is titled “Error” if both errors and
warnings exist.
Confirmations and errors cannot be shown together. In this case, the OA Framework simply ignores the
confirmation message(s).
You can, however, show confirmations with warnings. The message box is titled “Confirmation,” and it
contains both types of messages.
Show the Exception Message on a Dialog Page
You can display an exception as a message in a dialog page using the APIs in the
oracle.apps.fnd.framework.webui.OADialogPage class and oracle.apps.fnd.framework.webui.OAPageContext
interface.
The OADialogPage class holds properties for the generic dialog page. To create a dialog page object, first use the
constructors to instantiate the basic properties, then use the setter methods provided in the class to set additional
properties.
To navigate (redirect) to a dialog page, use the OAPageContext.redirectToDialogPage methods. The
OAPageContext interface contains the context and state information specific for a client request.
01 // To Diaplay the Exception on a Dialog page
/oracle/apps/icx/por/wf/webui/customizations/site/0/ReqLinesNotificationsRN
2
-username apps -password w3lcome123 \
-dbconnection
3 "(description=(address_list=(address=(protocol=tcp)(host=myhost)(port=12345
)))(connect_data=(sid=dev)))" -rootdir "$XXSCM_TOP/install" \
Here one file named ReqLinesNotificationsRN.xml will be created in the below path:
XXSCM_TOP/install/oracle/apps/icx/por/wf/webui/customizations/site/0. Open the file and you will able to view the
personalizations that you have done.
4. Use XMLImporter to import personalization document
Run the below command in the Instance where you want to import your personalization.
1 java oracle.jrad.tools.xml.importer.XMLImporter \
2 <full path of the file you want to import> \
3 -username "<username>" -password "<password>" \
-dbconnection
4 "(description=(address_list=(address=(protocol=tcp)(host=<host>)(port=<port
>)))(connect_data=(sid=<sid>)))" -rootdir "<top level directory>" \
5 -rootPackage "/oracle/apps/<prod>"
Example:
1 java oracle.jrad.tools.xml.importer.XMLImporter \
2 $XXSCM_TOP/install/ReqLinesNotificationsRN.xml \
3 -username apps -password w3lcome123 \
-dbconnection "(description=(address_list=(address=(protocol=tcp)(host=
4 myhost)(port=12345)))(connect_data=(sid=dev)))" -rootdir
"$XXSCM_TOP/install" \
5 -rootPackage "oracle/apps/icx/por/wf/server"