AppsLead OAF Cases



Comments



Description

2013www.AppsLead.com Oracle Applications Framework Business Cases Cell phone 002/010 900 160 23 Prepared By: Mostafa El-Roby We guide you to the right path in Oracle Applications AppsLead for Consultation and Training January 16th , 2013 Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 OAF Hello World Tutorial Create OAF Search Page Create Auto Customization Criteria OAF Search Page Clear/ Reset Result Table of Search page in OAF Create Data Entry OAF Page Update Records in OAF Page Create and Update on one click in OA Framework Delete records in OAF Page Implement Master Detail Relationship in OAF Page Working with Key Flex Fields in OAF Implement Dependent LOV in OAF Implement External LOV in OAF Set default Value for messageTextInput item Implement PopList in OA Framework Partial Page Rendering in OAF Execute parameterized PL SQL procedure from OAF page Implement Train in OAF Page D2k to OAF Transformation Call D2K Form from OAF Page Call OAF Page From D2K Form Get Host Name and URL of OAF Page OAF Page to Upload Files into Server from Local Machine Deploy JAR File into R12 in OA Server Copyright © 2013, AppsLead. All rights reserved Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Import Data from Excel sheet to DB Table Import Data from *.xlsx file to DB Table Deploy OAF page Bounce Apache Server Enable Personalization Link for OAF Pages Enable Personalization Link for OAF Pages Deploy JAR File into R12 in OA Server Controller Extension in OAF Application Module Extension in OAF EO based VO Extension in OAF Entity Object Extension in OAF OA Framework Best Practices OAException Message and Dialog Page in OA Framework Deploying OAF Personalizations Command Line Tools Using the Import/Export Best Blog :1- http://iwidi.org/index.php/oaf Copyright © 2013, AppsLead. All rights reserved Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Basic Installation Steps 1. Download JDeveloper 10.1.3.3.0. Available Oracle patch is p8431482_R12_GENERIC.zip Unzip the patch p8431482_R12_GENERIC.zip i.e. in D:\ 2. Specify the path of jdev in following location My Computer>Properties>Advanced>Environment Variables as given below screen shot Copyright © 2013, AppsLead. All rights reserved Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 3. Download dbc file of Oracle application instance from $FND_TOP/secure ( it is like a tnsnames.ora file having connection detail ) Place the file at location D:\p8431482_R12_GENERIC\jdevhome\jdev\dbc_files\secure 4. Open JDeveloper and set database connection goto Connection Navigator > Database and create a new connection Copyright © 2013, AppsLead. All rights reserved AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Note Give user name and password do not give any role and do not check Deploy Password checkbox Copyright © 2013. AppsLead. All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Note Give Host Name. Now JDeveloper is ready to use 5. Give workspace name Copyright © 2013. and SID. Goto Application Navigator right click > New > General > Workspace Configured for Oracle Applications 2. Keep driver as thin. Create a sample workspace and project to know setting during creation of project 1. All rights reserved . JDBC port. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 3.<application_short_name>.po.apps. [<subcomponent>] Example: mycompany. All rights reserved .webui Copyright © 2013. AppsLead.oracle. Give project name and Default package Note Default package is <3rd party identifier>.oracle.requisition.apps.<component>. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 4. Give database connection detail 5. Give your dbc file location, application username, application password, application short name, and responsibility key i.e. Application short key and responsibility key is nothing but assigned responsibility detail to the application user for example if application user has System Administrator responsibility then Application short name will be “SYSADMIN” and responsibility key will be “SYSTEM_ADMINISTRATOR”. These values are required to compile and run the page because page required context during run time so it will login the application with given username and password and it will take context from assigned responsibility Copyright © 2013, AppsLead. All rights reserved Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 6. Click Next. Creation of Workspace and project has finished Copyright © 2013, AppsLead. All rights reserved Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 OAF Hello World Tutorial 1. Create a New OA Workspace and Empty OA Project File> New > General> Workspace Configured for Oracle Applications Copyright © 2013, AppsLead. All rights reserved Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013, AppsLead. All rights reserved Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013, AppsLead. All rights reserved All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. AppsLead. AppsLead. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. Set Run Options in OA Project Setting Select Your Project in the Navigator and choose Project Properties Select Oracle Applications > Run Options Select OADeveloperMode and OADiagnostic. AppsLead. and move them to selected Options List Copyright © 2013. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 2. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 3. Create Application Module AM Copyright © 2013. All rights reserved . AppsLead. AppsLead. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . AppsLead. AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . AppsLead. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . AppsLead. Create a OA components Page Copyright © 2013.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 4. AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . Modify the Page Layout (Top-level) Region Copyright © 2013. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 5. AppsLead. All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Attribute ID Region Style Form Property Auto Footer Window Title Property PageLayoutRN pageLayout True True Hello World Window Title Copyright © 2013. All rights reserved .apps. AppsLead.HelloA M Copyright © 2013.server.hello.ak.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Title AM Definition Hello World Page Header prajkumar.oracle. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 6. AppsLead. All rights reserved . Create the first Item (Empty Field) MainRN > New > messageTextInput Copyright © 2013. Create the Second Region (Main Content Region) Attribute ID Region Style Property MainRN messageComponentLayout 7. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Attribute ID Style Property Prompt Length Maximum Length Property HelloName messageTextInput Name 20 50 Copyright © 2013. AppsLead. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 8. Create a container Region for Go-Button MainRN > messageLayout Copyright © 2013. AppsLead. All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Attribute ID Property ButtonLayout Copyright © 2013. All rights reserved . All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 9. Create a Second Item (Go Button) Select ButtonLayout > New > Item Copyright © 2013. AppsLead. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Attribute ID Item Style Attribute Property Go submitButton /oracle/apps/fnd/attributesets/Buttons/Go Copyright © 2013. All rights reserved . AppsLead. AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . Save Your Work 11. Run Your Page UI is ready Copyright © 2013. AppsLead. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 10. AppsLead. All rights reserved . Add a Controller MainRN > Set New Controller Copyright © 2013.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 12. AppsLead.fnd.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 13.processFormRequest(pageContext.OAException.apps. Add Following Code in processFormRequest public void processFormRequest(OAPageContext pageContext. All rights reserved . webBean).getParameter("Go") != null) { Copyright © 2013. if (pageContext. Edit Your Controller Add Following OA Exception as a last line in import section import oracle.framework. OAWebBean webBean) { super. String message = "Hello. All rights reserved .INFORMATION). OAException. } } Copyright © 2013. " + userContent + "!".Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 String userContent = pageContext.getParameter("HelloName"). AppsLead. throw new OAException(message. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 14. Build Your Controller 15. Test Your Work Your Hello World Page is Ready Copyright © 2013, AppsLead. All rights reserved Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013, AppsLead. All rights reserved Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Create OAF Search Page 1. Create a New Workspace and Project Right click Workspaces and click create new OAworkspace and name it as PRajkumarSearch. Automatically a new OA Project is also created. Name the project as SearchDemo and package as prajkumar.oracle.apps.fnd.searchdemo 2. Create a New Application Module (AM) Right Click on SearchDemo > New > ADF Business Components > Application Module Name -- SearchAM Package -- prajkumar.oracle.apps.fnd.searchdemo.server 3. Enable Passivation for the Root UI Application Module (AM) Right Click on SearchAM > Edit SearchAM > Custom Properties > Name – RETENTION_LEVEL Value – MANAGE_STATE Click add > Apply > OK 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 ); Copyright © 2013, AppsLead. All rights reserved Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 INSERT 0); INSERT 0); INSERT 0); INSERT 0); INTO xx_search_demo VALUES (‘val1’, ’val2’, SYSDATE, 0, SYSDATE, 0, INTO xx_search_demo VALUES (‘val1’, ’val2’, SYSDATE, 0, SYSDATE, 0, INTO xx_search_demo VALUES (‘val3’, ’val4’, SYSDATE, 0, SYSDATE, 0, INTO xx_search_demo VALUES (‘val5’, ’val6’, SYSDATE, 0, SYSDATE, 0, Now we have 4 records in our custom table 5. Create a New Entity Object (EO) Right click on SearchDemo > New > ADF Business Components > Entity Object Name – SearchEO Package -- prajkumar.oracle.apps.fnd.searchdemo.schema.server Database Objects -- XX_SEARCH_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 6. Create a New View Object (VO) Right click on SearchDemo > New > ADF Business Components > View Object Name -- SearchVO Package -- prajkumar.oracle.apps.fnd.searchdemo.server In Step2 in Entity Page select SearchEO and shuttle them to selected list In Step3 in Attributes Window select columns Column1, Column2 and shuttle them to selected list In Java page Select Generate Java file for View Object Class: SearchVOImpl and Generate Java File for View Row Class: SearchVORowImpl 7. Add Your View Object to Root UI Application Module Select Right click on SearchAM > Edit SearchAM > Data Model > Copyright © 2013, AppsLead. All rights reserved Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Select SearchVO and shuttle to Data Model list 8. Create a New Page Right click on SearchDemo > New > Web Tier > OA Components > Page Name -- SearchPG Package -- prajkumar.oracle.apps.fnd.searchdemo.webui 9. Select the SearchPG and go to the strcuture pane where a default region has been created 10. Select region1 and set the following properties: ID -- PageLayoutRN Region Style -- PageLayout AM Definition -- prajkumar.oracle.apps.fnd.searchdemo.server.SearchAM Window Title -- Search Page Window Title -- Search Page Auto Footer -- True 11. Add a Query Bean to Your Page Right click on PageLayoutRN > New > Region Select new region region1 and set following properties ID – QueryRN Region Style – query Construction Mode – resultBasedSearch Include Simple Panel – True Include Views Panel – True Include Advanced Panel – True 12. Add a Result Data Table to your QueryRN Select QueryRN right click > New > Region using Wizard Copyright © 2013, AppsLead. All rights reserved Select your SearchAM and then select your SearchVO1 Note – DO NOT select Use this as Application Module Definition for this region checkbox In Region Properties page. Set or Verify Column1 Item Properties Search Allowed -. Style and Attributes Set. Set and verify Your Results Table Region Properties ID – ResultsTable Region Style – table AM – Please Donot put any AM Rendered – True Records Displayed – 10 Width – 100% User Personalization – True 14. Currently we are going to set only Style as messageStyledText 13.True Sort Allowed – ascending Initial Sort Seqence – first Selective Search Criteria – True User Personalization – True Copyright © 2013. you can set ID. set Region ID value to ResultsTable and Region Style to table In view Attributes page.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 In BC4J Objects page. All rights reserved . select attributes from Available View Attributes list and shuttle them to Selected View Atributes list: Column1 Column2 In Region Items Page. AppsLead. ascending Selective Search Criteria – True User Personalization – True 16.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 15. Congratulation you have successfully finished Search page. Set or Verify Column2 Item Properties Search Allowed – True Sort Allowed -. All rights reserved . AppsLead. Run Your SearchPG page and Test Your Work Copyright © 2013. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. AppsLead. oracle. AppsLead.---------------------.CustSearchAM Package -.--------------------last_update_date DATE NOT NULL. column2 VARCHAR2(100). All rights reserved .custsearchdemo 2. Create a New Workspace and Project Right click Workspaces and click create new OAworkspace and name it as PRajkumarCustSearch.apps.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Create Auto Customization Criteria OAF Search Page 1. Create a New Application Module (AM) Right Click on CustSearchDemo > New > ADF Business Components > Application Module Name -.apps. column3 VARCHAR2(100). Enable Passivation for the Root UI Application Module (AM) Right Click on CustSearchAM > Edit SearchAM > Custom Properties > Name – RETENTION_LEVEL Value – MANAGE_STATE Click add > Apply > OK 4. Create Test Table and insert data some data in it (For Testing Purpose) CREATE TABLE xx_custsearch_demo ( -. Automatically a new OA Project will also be created.prajkumar. Name the project as CustSearchDemo and package as prajkumar.---------------------.custsearchdemo. last_updated_by NUMBER NOT NULL.Who Columns -.fnd. Copyright © 2013.oracle.fnd. -. column4 VARCHAR2(100).Data Columns -.--------------------column1 VARCHAR2(100).server 3. 0. Create a New Entity Object (EO) Right click on SearchDemo > New > ADF Business Components > Entity Object Name – CustSearchEO Package -.fnd.0.SYSDATE.SYSDATE.SYSDATE.0.'v6'.0.'v5'.custsearchdemo.server Database Objects -.'v5'.0.prajkumar.'v4'. Now we have 4 records in our custom table 5. All rights reserved .'v3'.XX_CUSTSEARCH_DEMO Note – By default ROWID will be the primary key if we will not make any column to be primary key Check the Accessors.schema.SYSDATE. INSERT INTO xx_custsearch_demo VALUES('v1'.SYSDATE.fnd.SYSDATE. Validation Method and Remove Method 6. INSERT INTO xx_custsearch_demo VALUES('v2'.0). Create Method.0.CustSearchVO Package -.'v2'.'v4'. Create a New View Object (VO) Right click on CustSearchDemo > New > ADF Business Components > View Object Name -.apps.apps.SYSDATE. created_by NUMBER NOT NULL.server In Step2 in Entity Page select CustSearchEO and shuttle them to selected list Copyright © 2013.'v4'.prajkumar. last_update_login NUMBER ).0).oracle.SYSDATE.'v5'.0).'v3'.0).'v4'.0. INSERT INTO xx_custsearch_demo VALUES('v1'. AppsLead.custsearchdemo.'v3'.0. INSERT INTO xx_custsearch_demo VALUES('v3'.oracle.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 creation_date DATE NOT NULL. oracle.fnd. Column4. Create a New Page Right click on CustSearchDemo > New > Web Tier > OA Components > Page Name -. Select the CustSearchPG and go to the strcuture pane where a default region has been created 10. All rights reserved . Column2. Select region1 and set the following properties: ID -.CustSearchAM Window Title – AutoCustomize Search Page Window Title – AutoCustomization Search Page Auto Footer -. Column3.custsearchdemo.True 11.webui 9.CustSearchPG Package -. AppsLead. 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 7. Add Your View Object to Root UI Application Module Select Right click on CustSearchAM > Application Modules > Data Model Select CustSearchVO and shuttle to Data Model list 8.apps.custsearchdemo.prajkumar.apps.oracle. Add a Query Bean to Your Page Right click on PageLayoutRN > New > Region Copyright © 2013.PageLayoutRN Region Style -.server.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 In Step3 in Attributes Window select columns Column1.fnd.PageLayout AM Definition -prajkumar. oracle.server. Select CustSearchTable in Structure Panel and set property Width to 100% 14. All rights reserved . Create a New Region of style table Right Click on QueryRN > New > Region Using Wizard Application Module – prajkumar. AppsLead. 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. Include Simple Search Panel Right Click on QueryRN > New > simpleSearchPanel Automatically region2 (header Region) and region1 (MessageComponentLayout Region) created Set Following Properties for region2 Copyright © 2013.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Select new region region1 and set following properties ID – QueryRN Region Style – query Construction Mode – autoCustomizationCriteria Include Simple Panel – False Include Views Panel – False Include Advanced Panel – False 12.apps.custsearchdemo. Column2.fnd.CustSearchAM Available View Usages – CustSearchVO1 In Step2 in Region Properties set following properties Region ID – CustSearchTable Region Style – Table In Step3 in View Attributes shuttle all the items (Column1. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Id – SimpleSearchHeader Text -. Now Right Click on query Components and create simple Search Mappings. All rights reserved .True Data Type – VARCHAR2 Maximum Length – 100 CSS Class – OraFieldText Prompt – Column2 16. Now select the QueryCriteriaMap1 and set the below properties Id – SearchColumn1Map Search Item – SearchColumn1 Result Item – Column1 Copyright © 2013.Simple Search 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 -. Then automatically SimpleSearchMappings and QueryCriteriaMap1 created 17. AppsLead. AppsLead. Run Your CustSearchPG page and Test Your Work Copyright © 2013. Congratulation you have successfully finished Auto Customization Search page. All rights reserved . and then set the below properties Id – SearchColumn2Map Search Item – SearchColumn2 Result Item – Column2 19. Now again right click on simpleSearchMappings -> New -> queryCriteriaMap.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 18. All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . AppsLead. webui.framework. 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 Copyright © 2013...beans. All rights reserved .clearSearchPersistenceCache(pageContext).findChildRecursive("QueryRN").layout. OAWebBean webBean) { super.fnd.apps.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Clear/ Reset Result Table of Search page in OAF Normally problem faced by developers after creating Search Page is how to Clear/ Reset Result Table when developer open search page first time or after search when developer redirecting back to same search page from any other page (say delete page or update page) Add following Code in your Search page Controller where you have constructed your Query Region import oracle. AppsLead. webBean).processRequest(pageContext. OAQueryBean queryBean = (OAQueryBean)webBean. public void processRequest(OAPageContext pageContext. } Note – After add this code. // Here QueryRN is your Query Region Name as shown in following snap shot queryBean. .OAQueryBean. no need to worry about state of Application Module (AM). All rights reserved . AppsLead. But still as per good coding standard while redirecting back to search page always keep AM state to FALSE Copyright © 2013.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 page. All rights reserved . AppsLead. column2 VARCHAR2(100). Create Test Table in which we will insert data (For Testing Purpose) CREATE TABLE xx_insert_demo ( -. Name the project as InsertDemo and package as prajkumar.insertdemo. Enable Passivation for the Root UI Application Module (AM) Right Click on InsertAM > Edit InsertAM > Custom Properties > Name – RETENTION_LEVEL Value – MANAGE_STATE Click add > Apply > OK 4.apps. Automatically a new OA Project is also created. last_update_login NUMBER Copyright © 2013. created_by NUMBER NOT NULL. 2012 1.apps.---------------------.InsertAM Package -.fnd.--------------------column1 VARCHAR2(100).insertdemo 2.server 3.--------------------last_update_date DATE NOT NULL.fnd.Who Columns -.prajkumar. Create a New Workspace and Project Right click Workspaces and click create new OAworkspace and name it as PRajkumarInsert.oracle. Create a New Application Module (AM) Right Click on InsertDemo > New > ADF Business Components > Application Module Name -. creation_date DATE NOT NULL.oracle.---------------------.Data Columns -. last_updated_by NUMBER NOT NULL. -.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Create Data Entry OAF Page By PRajkumar on Apr 22. fnd.server Database Objects -. Check the Accessors. 5.insertdemo. Validation Method and Remove Method 6.fnd. Column2 and shuttle them to selected list In Java page deselect Generate Java file for View Object Class: InsertVOImpl and Select Generate Java File for View Row Class: InsertVORowImpl 7.XX_INSERT_DEMO Note – By default ROWID will be the primary key if we will not make any column to be primary key. Create a New View Object (VO) Right click on InsertDemo > New > ADF Business Components > View Object Name -.InsertVO Package -. AppsLead. All rights reserved .oracle.oracle.apps.prajkumar.insertdemo. Create a New Page Right click on InsertDemo > New > Web Tier > OA Components > Page Name -.server In Step2 in Entity Page select InsertEO and shuttle them to selected list In Step3 in Attributes Window select columns Column1.prajkumar.InsertPG Package -.insertdemo.oracle. Add Your View Object to Root UI Application Module Right click on InsertAM > Edit InsertAM > Data Model > Select InsertVO in Available View Objects list and shuttle to Data Model list 8.apps.fnd.schema. Create a New Entity Object (EO) Right click on InsertDemo > New > ADF Business Components > Entity Object Name – InsertEO Package -.webui Copyright © 2013. Create Method.prajkumar.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 ).apps. AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 9.insertdemo.True 11.apps.PageLayoutRN Region Style -.100 Length -.Column1 Again Right click on MainRN > New > Item Set following properties for New Item ID -.Data Entry Page Auto Footer -.prajkumar.InsertVO1 View Attribute -.InsertAM Window Title -.COLUMN1 Item Style -.PageLayout AM Definition -. All rights reserved . Select region1 and set the following properties: ID -. Select the InsertPG and go to the strcuture pane where a default region has been created 10.MainRN Region Style -. Create Text Input Items Right click on MainRN > New > Item Set following properties for New Item ID -.server.messageTextInput Maximum Length -.COLUMN2 Copyright © 2013.fnd. Right click PageLayoutRN > New > Region ID -.Date Entry Page Window Title -.Column1 View Instance -.defaultSingleColumn 12.oracle.20 Prompt -. AppsLead.20 Prompt -. Right click on PageButtons > New > Item ID -./oracle/apps/fnd/attributesets/Buttons/Apply Prompt -.PageButtons Region Style -.False Additional Text – Select to cancel this transaction.pageButtonBar Right click on PageButtons > New > Item ID -.Apply Item Style -.100 Length -.Column2 View Instance -.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Item Style -.True Prompt -.messageTextInput Maximum Length -. Implement Row Initialization (Create a View Object Row) Copyright © 2013. All rights reserved .submitButton Attribute Set -. Add Apply and Cancel Buttons Right click on PageLayoutRN > New > Region ID -.Apply Additional Text – Select to save this transaction.Cancel Warm About Changes -.Cancel Item Style -./oracle/apps/fnd/attributesets/Buttons/Cancel Disable Server Side Validation -.submitButton Attribute Set -.InsertVO1 View Attribute – Column2 13. 14. } Row row = vo.isPreparedForExecution()) { vo. All rights reserved .fnd. vo.apps. Create Controller for Page PageLayoutRN > Set New Controller > Package Name: prajkumar.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Add createRecord method to your InsertAMImpl class import oracle. AppsLead.apps.getApplicationModule(webBean). } } Copyright © 2013.framework. . if (!pageContext. row.fnd..jbo.insertdemo.. public void processRequest(OAPageContext pageContext..processRequest(pageContext.framework.createRow(). if (!vo.. Add Create Page Initialization to your Controller Add following code to your processRequest() import oracle.insertRow(row).OAViewObject. .oracle.Row.invokeMethod("createRecord".executeQuery(). webBean).OAApplicationModule.setNewRowState(Row. } 15.isFormSubmission()) { OAApplicationModule am = pageContext.OAWebBean webBean) { super. import oracle. am.apps. public void createRecord() { OAViewObject vo = (OAViewObject)getInsertVO1().webui Class Name: InsertCO 16. null).fnd.STATUS_INITIALIZED). oracle. OAWebBean webBean) {super.jbo. new MessageToken("COLUMN2". } 18.getAttribute("Column1"). oracle.MessageToken..processFormRequest(pageContext.. public void apply() { getTransaction().findViewObject("InsertVO1"). .. OAApplicationModule am = pageContext. String column1 = (String)vo.fnd.commit().getApplicationModule(webBean).common.domain.framework.fnd.getAttribute("Column2").fnd.. All rights reserved .invokeMethod("apply").framework.apps.apps. String column2 = (String)vo.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 17.OAWebBeanConstants.apps.OAViewObject.webui. // Create a FND Message with name "TEST_CREATE_CONFIRM" with two // tokens MessageToken[] tokens = { new MessageToken("COLUMN1".getCurrentRow(). Add below method in InsertAMImpl Class to handle Apply Button action import oracle. column2) Copyright © 2013. webBean). oracle. if (pageContext. column1). oracle. am.OAException.framework. Add below Logic in InsertCO to handle Apply Button Add following code to your processFormRequest() import import import import import . public void processFormRequest(OAPageContext pageContext.fnd.Transaction.apps.jbo.getParameter("Apply") != null) { OAViewObject vo = (OAViewObject)am.Number.getCurrentRow(). AppsLead. oracle. // Pressing the "Apply" button means the transaction should be // validated and committed. forwardImmediately( "OA. null). null. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 }. OAException confirmMessage = new OAException( "FND". true. null.ADD_BREAD_CRUMB_NO). "TEST_CREATE_CONFIRM".CONFIRMATION. tokens. null.jsp?page=/prajkumar/oracle/apps/fnd/insertdemo/webui/InsertPG". pageContext. } } Copyright © 2013. OAException. OAWebBeanConstants. // retain AM OAWebBeanConstants.putDialogMessage(confirmMessage). AppsLead.KEEP_MENU_CONTEXT. pageContext. Run InsertPG page to test Your Work Copyright © 2013. All rights reserved . Congratulations you have successfully created data insert page.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 19. AppsLead. AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . ${oa. Implement Update Action in SearchPG Right click on ResultTable in SearchPG > New > Item Set following properties for New Item Attribute ID Item Style Image URI Atribute Set Prompt Additional Text Height Width Action Type Event Submit Parameters Property UpdateAction image updateicon_enabled.com/prajkumar/entry/create_oaf_search_page 2. All rights reserved .Column1} Copyright © 2013.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Update records in OAF Page 1.SearchVO1.gif /oracle/apps/fnd/attributesets/Buttons/Update Update Update record 24 24 fireAction update True Name – PColumn1 Value -. Create a Search Page to Create a page please go through the following link https://blogs. AppsLead.oracle. Select the UpdatePG and go to the strcuture pane where a default region has been created 5.fnd.fnd.server.apps. Create a Update Page Right click on SearchDemo > New > Web Tier > OA Components > Page Name – UpdatePG Package – prajkumar. All rights reserved . Create the Second Region (Main Content Region) Select PageLayoutRN right click > New > Region ID – MainRN Region Style – messageComponentLayout Copyright © 2013.SearchA M Update Page Window Update Page True Window Title Title Auto Footer 6.oracle.searchdemo.Column2} 3.webui 4.oracle.searchdemo.apps. Select region1 and set the following properties: Attribute ID Region Style AM Definition Property PageLayoutRN PageLayout prajkumar.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Name – PColumn2 Value -. AppsLead.${oa.SearchVO1. Create first Item (Empty Field) MainRN > New > messageTextInput Attribute ID Style Property Prompt Data Type Length Maximum Length View Instance View Attribute Property Column1 messageTextInput Column1 VARCHAR2 20 100 SearchVO1 Column1 8.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 7. All rights reserved . AppsLead. Create second Item (Empty Field) MainRN > New > messageTextInput Attribute ID Style Property Prompt Data Type Length Maximum Length Property Column2 messageTextInput Column2 VARCHAR2 20 100 Copyright © 2013. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 View Instance View Attribute SearchVO1 Column2 9. Create a container Region for Apply and Cancel Button in UpdatePG Select MainRN of UpdatePG MainRN > messageLayout Attribute Region Property ButtonLayout 10. AppsLead. Create Apply Button Select ButtonLayout > New > Item Attribute ID Item Style Attribute Property Apply submitButton /oracle/apps/fnd/attributesets/Buttons/Apply 11. Create Cancel Button Select ButtonLayout > New > Item Attribute ID Item Style Property Cancel submitButton Copyright © 2013. All rights reserved . null.apps.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Attribute /oracle/apps/fnd/attributesets/Buttons/Cancel 12.processFormRequest(pageContext. AppsLead.webui.OAPageContext.fnd.searchdemo. All rights reserved . OAQueryBean queryBean = (OAQueryBean)webBean.fnd. if ("update".ADD_BREAD_CRUMB_NO.framework.apps.fnd.setForwardURL("OA.KEEP_MENU_CONTEXT.OAQueryBean.webui.processRequest(pageContext.webui Add Following code in Search Page controller SearchCO import import import import oracle.beans.fnd. Add Page Controller for SearchPG Right Click on PageLayoutRN of SearchPG > Set New Controller Name – SearchCO Package -.beans. OAWebBean webBean) { super. null.webui. webBean). true.apps. oracle. null.jsp? page=/prajkumar/oracle/apps/fnd/searchdemo/webui/UpdatePG".OAWebBean.webui. queryBean. oracle.framework.findChildRecursive("QueryRN"). webBean).apps.equals(pageContext. } public void processFormRequest(OAPageContext pageContext.OAWebBeanConstants.fnd.apps.layout. OAWebBean webBean) { super. public void processRequest(OAPageContext pageContext. OAWebBeanConstants. Copyright © 2013.getParameter(EVENT_PARAM))) { pageContext.framework.oracle.clearSearchPersistenceCache(pageContext).prajkumar. OAWebBeanConstants.framework. oracle. OAWebBean. OAApplicationModule am = pageContext.apps. Column2 }. } } 13. Add Page Controller for UpdatePG Right Click on PageLayoutRN of UpdatePG > Set New Controller Name – UpdateCO Package -.apps. OAWebBean webBean) { super.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 OAWebBeanConstants.OAWebBeanConstants.framework.getParameter("Apply") != null) { am. oracle.forwardImmediately("OA.processRequest(pageContext. oracle.OAPageContext.processFormRequest(pageContext. am.beans.fnd. public void processRequest(OAPageContext pageContext.fnd.jsp? page=/prajkumar/oracle/apps/fnd/searchdemo/webui/SearchPG". params). Copyright © 2013. pageContext. OAApplicationModule am = pageContext.framework.getApplicationModule(webBean).invokeMethod("updateRow".fnd.apps. java. Serializable[] params = { Column1.KEEP_MENU_CONTEXT.framework. All rights reserved .webui.io. } public void processFormRequest(OAPageContext pageContext. null.IGNORE_MESSAGES).prajkumar.webui Add Following code in Update Page controller UpdateCO import import import import import oracle.OAApplicationModule.Serializable.getParameter("PColumn1"). webBean).apps.getParameter("PColumn2"). OAWebBean webBean) { super.framework.webui. OAWebBeanConstants.webui. oracle.fnd. AppsLead. String Column1 = pageContext.oracle. if (pageContext.searchdemo. webBean). String Column2 = pageContext.getApplicationModule(webBean).fnd.apps.invokeMethod("apply"). null. forwardImmediately("OA. null. } } 14.initQuery(Column1.invokeMethod("rollback"). OAWebBeanConstants.jsp? page=/prajkumar/oracle/apps/fnd/searchdemo/webui/SearchPG". Add following Code in SearchVOImpl Copyright © 2013.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 null. null.apps.fnd. // retain AM OAWebBeanConstants. } public void rollback() { getTransaction(). Column2). null.apps. false. false.KEEP_MENU_CONTEXT.getParameter("Cancel") != null) { am. AppsLead. } else if (pageContext. } public void apply() { getTransaction().framework. vo. // retain AM OAWebBeanConstants. Add following Code in SearchAMImpl import oracle.framework. import oracle.server.server.ADD_BREAD_CRUMB_NO). public void updateRow(String Column1. } 15.ADD_BREAD_CRUMB_NO). String Column2) { SearchVOImpl vo = (SearchVOImpl)getSearchVO1(). All rights reserved .OAApplicationModuleImpl.commit().fnd.rollback().OAViewObjectImpl. pageContext. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 import oracle. AppsLead.fnd.framework. All rights reserved . public void initQuery(String Column1.OAViewObjectImpl. Column1).trim())))) { setWhereClause("column1 = :1 AND column2 = :2").server. } } 16. setWhereClauseParams(null).apps. Run Your Search page and Test Your Work Copyright © 2013. setWhereClauseParam(1. Congratulation you have successfully finished. String Column2) { if ((Column1 != null) && (!("". Column2).equals(Column1. executeQuery(). // Always reset setWhereClauseParam(0. AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . AppsLead. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. Based on that new data can be inserted there and existing data can be updated directly with one button click ‘Apply’ 1.fnd. File Name – PrajkumarSearch Project Name -.searchdemo 2.prajkumar.SearchAM Package -. AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Create and Update on one click in OA Framework We will try to implement Search Page with one text item as ID. ID will be displayed on second page as Styled Text in all three rows If match will be found based on ID then search result will come.fnd.prajkumar.apps.oracle. Enable Passivation for the Root UI Application Module (AM) Right Click on SearchAM > Edit SearchAM > Custom Properties > Name – RETENTION_LEVEL Value – MANAGE_STATE Click add > Apply > OK 4.apps. All rights reserved .searchdemo.---------------------. Create Test Table and insert data some data in it (For Testing Purpose) CREATE TABLE xx_create_upd_demo ( -.SearchDemo package -. Create a New Workspace and Project Right click Workspaces and click create new OAworkspace. Second page contain three text rows.oracle. Based on ID control will go to second page.server 3. Create a New Application Module (AM) Right Click on SearchDemo > New > ADF Business Components > Application Module Name -.Data Columns Copyright © 2013. If not found then empty rows will come. apps. VARCHAR2(100). AppsLead. Create Method.SearchVO Package -.xx_create_upd_demo Note – By default ROWID will be the primary key if we will not make any column to be primary key. Column2. Column4 and shuttle them to selected list In Java page select Generate Java File for View Object Class: SearchVOImpl and Generate Java File for View Row Class: SearchVORowImpl Copyright © 2013. NOT NULL.oracle.prajkumar. DATE NUMBER DATE NUMBER NUMBER NOT NULL. Create a New Entity Object (EO) Right click on SearchDemo > New > ADF Business Components > Entity Object Name – SearchEO Package -. Create a New View Object (VO) Right click on SearchDemo > New > ADF Business Components > View Object Name -. Column3.Who Columns -.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 -.---------------------.schema. NUMBER.server In Step2 in Entity Page select SearchEO and shuttle them to selected list In Step3 in Attributes Window select columns Column1. 5. All rights reserved .searchdemo. NOT NULL.searchdemo.apps. VARCHAR2(100).---------------------column1 column2 column3 column4 -.fnd. VARCHAR2(100).server Database Objects -.fnd.oracle.--------------------last_update_date last_updated_by creation_date created_by last_update_login ). Validation Method and Remove Method 6. Check the Accessors.prajkumar. NOT NULL. oracle. Create the first Item (Empty Field) MainRN > New > messageTextInput Set Following properties for new item Copyright © 2013.apps.searchdemo. Create a New Page Right click on SearchDemo > New > Web Tier > OA Components > Page Name -.prajkumar.fnd.SearchPG Package -.fnd.oracle.searchdemo. AppsLead. Create the Second Region (Main Content Region) ID – MainRN Region Style -.PageLayout AM Definition -.SearchAM Window Title –Page Window Title – Page Header Auto Footer – True 11.server. All rights reserved . Select the SearchPG and go to the strcuture pane where a default region has been created 10.messageComponentLayout Auto Footer – True 12.apps. Add Your View Object to Root UI Application Module Select Right click on SearchAM > Application Modules > Data Model > Select SearchVO and shuttle to Data Model list 8.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 7.prajkumar.webui 9. Select region1 and set the following properties: ID – PageLayoutRN Scope -.Public Region Style -. Select region1 and set the following properties: ID – PageLayoutRN Scope -.oracle. AppsLead. Select the CreateUpdPG and go to the strcuture pane where a default region has been created 17.prajkumar.fnd.oracle.searchdemo.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 ID – MyId Style Property – messageTextInput Prompt – Id Data Type – Number Length – 20 Maximum Length – 100 13.apps.webui 16.PageLayout AM Definition -.CreateUpdPG Package -./oracle/apps/fnd/attributesets/Buttons/Go 15.fnd. Create a container Region for Go-Button MainRN > messageLayout Set ID -.apps.searchdemo. Create a Item (Go Button) Select ButtonLayout > New > Item ID – Go Item Style – submitButton Attribute -. All rights reserved .Public Region Style -.SearchAM Copyright © 2013.prajkumar.ButtonLayout 14.server. Create a New Second Page Right click on SearchDemo > New > Web Tier > OA Components > Page Name -. AppsLead. All rights reserved . Create the first Item (Empty Field) MainRN > New > item Set Following properties for new item ID – Column1 Style Property – messageTextInput Prompt – Column1 Data Type – VARCHAR2 Length – 20 Maximum Length – 100 View Instance -.Column1 Create Second Item MainRN > New > item Set Following properties for new item ID – Column2 Style Property – messageTextInput Prompt – Column2 Data Type – VARCHAR2 Copyright © 2013.SearchVO1 View Attribute -.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Window Title –Page Window Title – Page Header Auto Footer – True 18.table Auto Footer – True Records Displayed – 3 19. Create the Second Region (Main Content Region) ID – MainRN Region Style -. prajkumar.SearchVO1 View Attribute -.webui Copyright © 2013.fnd.apps.SearchVO1 View Attribute -. All rights reserved .Column2 Create Third Item MainRN > New > item Set Following properties for new item ID – Column3 Style Property – messageTextInput Prompt – Column3 Data Type – VARCHAR2 Length – 20 Maximum Length – 100 View Instance -.searchdemo.Column4 20.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Length – 20 Maximum Length – 100 View Instance -. AppsLead.SearchVO1 View Attribute -.oracle. Add Controller for Page SearchPG Select PageLayoutRN right click Set New Controller Package Name -.Column3 Create Fourth Item MainRN > New > item Set Following properties for new item ID – Column4 Style Property – messageStyledText Prompt – Column4 Data Type – NUMBER View Instance -. ADD_BREAD_CRUMB_NO. true.collections.KEEP_MENU_CONTEXT.webui.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Class Name -. if (pageContext. HashMap hmap = new HashMap().java. OAWebBeanConstants.IGNORE_MESSAGES). OAWebBeanConstants. null. import oracle.put("MyId". public void processFormRequest(OAPageContext pageContext.HashMap.jsp?page=/prajkumar/oracle/apps/fnd/searchdemo/webui/CreateUpdPG". OAWebBeanConstants. webBean).setForwardURL( "OA. hmap.getParameter("Go") != null) { String userContent = pageContext.util. } } 21.apps. All rights reserved . userContent). hmap.jsp? page=/prajkumar/oracle/apps/fnd/searchdemo/webui/SearchPG&retainAM=Y Text – Return to SearchPG Copyright © 2013.framework. pageContext.fnd.OAWebBeanConstants. OAWebBean webBean) { super. AppsLead.getParameter("MyId"). null. Add Return Link to come back to SearchPG from CreateUpdPG Select CreateUpdPG in Structure Panel Select PageLayoutRN > New > returnNavigation ID – ReturnLink Destination URI – OA.SearchCO Add Following code in that controller import com.processFormRequest(pageContext.sun. searchdemo.Serializable.prajkumar.io. Add pageButtonBar region to implement Apply Button Right click on PageLayout > New > Region Set following properties for new region ID -. OAWebBean webBean) Copyright © 2013.apps./oracle/apps/fnd/attributesets/Buttons/Apply 23. params). } public void processFormRequest(OAPageContext pageContext. OAWebBean webBean) { super.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 22.fnd.oracle.processRequest(pageContext.OAApplicationModule. String val = pageContext.ButtonBar Region Style – pageButtonBar Select ButtonBar right click > New > Item Select newly created item and set following properties – ID – Apply Item Style – submitButton Attribute Set -.framework. public void processRequest(OAPageContext pageContext. AppsLead. webBean). Add Controller for Page CreateUpdPG Select PageLayoutRN right click Set New Controller Package Name -. Serializable[] params = { val }.webui.fnd. import oracle.OAWebBeanConstants.webui Class Name -.getApplicationModule(webBean).apps.apps.fnd.framework. All rights reserved . OAApplicationModule am = pageContext. import oracle. am.CreateUpdCO Add Following code in that controller import java.getParameter("MyId").invokeMethod("createRow". IGNORE_MESSAGES).OAApplicationModuleImpl.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 { super.processFormRequest(pageContext.setCurrentRow(studrow). } } 24.fnd.getRowCount(). vo. OAApplicationModule am = pageContext. vo. OAWebBeanConstants. OAWebBeanConstants.insertRow(studrow).ADD_BREAD_CRUMB_NO. pageContext.last().STATUS_INITIALIZED). All rights reserved .KEEP_MENU_CONTEXT.java import oracle. null.setNewRowState(Row.apps.jbo. true. int rowCount = vo.getTransaction().setAttribute("Column4". } Copyright © 2013. vo. public void createRow(String Val) { SearchVOImpl vo = getSearchVO1(). import oracle. if (pageContext. vo. null. i != rowCount . Add Following code in SearchAMImpl.commit(). vo. AppsLead.framework.initQuery(Val).getCurrentRow(). OAWebBeanConstants. null.next().server. vo.createRow().getParameter("Apply") != null) { am.getApplicationModule(webBean). studrow.jsp? page=/prajkumar/oracle/apps/fnd/searchdemo/webui/SearchPG".Row. if ( rowCount < 3 ) { for(int i = 3.Val). rowCount++) { Row studrow = vo. webBean).setForwardURL( "OA. OAException. Run Your SearcgPG page and Test Your Work Copyright © 2013. // Always reset setWhereClauseParam(0. Add Following code in SearchVOImpl.apps. AppsLead.domain. All rights reserved .apps. "FWK_TBX_INVALID_EMP_NUMBER").Number.fnd. try { Val2 = new Number(Val). Congratulation you have successfully finished. Val2). setWhereClauseParams(null).equals(Val. } } 26. executeQuery().Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 } } 25. public void initQuery(String Val) { if ((Val != null) && (!("".java import oracle. import oracle. } setWhereClause("Column4 = :1"). Number Val2 = null. } catch(Exception e) { throw new OAException("AK".framework. import oracle.framework.OAViewObjectImpl.jbo.server.fnd.trim())))) { // Do the following conversion for type consistency. AppsLead. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . AppsLead. Create a Search Page to Create a page please go through the following link https://blogs. All rights reserved .Delete Additional Text – Delete record action enabled Height – 24 Width – 24 Action Type – fireAction Event – delete Submit – True Select Parameter Properties define parameter name as Column1 and whose value is ${oa.Column2} Select OK button to create your request parameters Copyright © 2013.com/prajkumar/entry/create_oaf_search_page 2. Create a Delete Image Select ResultsTable right click > New > Item Set following properties for New Item ID – DeleteAction Item Style – image Image URI – deleteicon_enabled./oracle/apps/fnd/attributesets/Buttons/Delete Prompt -.remove().oracle. } // end remove() 3.SearchVO1.Column1} Select Parameter Properties define parameter name as Column2 and whose value is ${oa. AppsLead. Implement a Delete in your SearchEOImpl Class public void remove() { super.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Delete Records in OAF Page 1.SearchVO1.gif Atribute Set -. framework.apps..remove().searchdemo. SearchVORowImpl row = null.fnd.OAApplicationModuleImpl. Add deleteRecord() method to SearchAMImpl import import import import import .jbo. oracle.fnd. i++) { row = (SearchVORowImpl)deleteIter. } } deleteIter.setRangeStart(0).apps.webui Implement Delete Action 5.fnd.OAViewObject.apps.createRowSetIterator("deleteIter"). } // end deleteRecord Note – Create Standard FND Messages DELETE_RECORD_WARN and DELETE_CONFIRM Copyright © 2013.server. AppsLead..Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 4.RowSetIterator. break.closeRowSetIterator().apps.getFetchedRowCount().oracle.prajkumar.setRangeSize(fetchedRowCount).domain. oracle.fnd. oracle.Number. getTransaction(). int fetchedRowCount = vo.OAViewObjectImpl.server. public void deleteRecord(String Column1) { OAViewObject vo = (OAViewObject)getSearchVO1(). Add Page Controller Add a New Contoller for SearchPG Name – SearchCO Package -. RowSetIterator deleteIter = vo. for (int i = 0. oracle. if (fetchedRowCount > 0) { deleteIter.framework.getRowAtRangeIndex(i). row. All rights reserved .framework.jbo. oracle.commit(). deleteIter. i < fetchedRowCount. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. AppsLead. .framework.fnd.OARow.processFormRequest() import import import import import import import import .fnd.apps. oracle..collections. oracle.OAWebBeanConstants.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 6.OADialogPage.sun.fnd. Copyright © 2013.framework. oracle. oracle.webui.apps. oracle. OAApplicationModule am = pageContext.webui. oracle.fnd.framework.java.fnd.fnd. oracle. Add DeleteSelection Handler Code to SearchCO. OAViewObject vo =(OAViewObject)am.OAException.getApplicationModule(webBean).OAWebBeanConstants. com.apps.common.util.apps.webui.framework. AppsLead.fnd.MessageToken.OAApplicationModule.framework.apps.framework.apps.apps.HashMap.findViewObject("SearchVO1"). All rights reserved . findRowByRef(rowRef). pageContext.setFormParameters(formParams). "FWK_TBX_T_NO". Add Delete Confirmation Handler Code to SearchCO. formParams. String yes = pageContext. null. dialogPage. dialogPage. null).setNoButtonLabel(no).Hashtable(1).setNoButtonToPost(true). "".Hashtable formParams = new java.put("Column2". "").util. AppsLead.processFormRequest() Copyright © 2013. dialogPage. String Column2 = (String)row. Column2)}. dialogPage.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REF ERENCE). Column4). OAException mainMessage = new OAException("FND". null).equals(pageContext.put("Column1".Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 String rowRef = pageContext.util. String no = pageContext.setPostToCallingPage(true). new MessageToken("COLUMN2". } 7.getParameter("Column2"). String Column3 = pageContext. dialogPage.setOkButtonItemName("DeleteYesButton").getMessage("AK". "FWK_TBX_T_YES". OARow row = (OARow)am. MessageToken[] tokens = { new MessageToken("COLUMN1". mainMessage. OADialogPage dialogPage = new OADialogPage(OAException. formParams. All rights reserved . dialogPage. String Column4 = pageContext.setOkButtonLabel(yes).redirectToDialogPage(dialogPage).getAttribute("Column1").getParameter("Column1").setOkButtonToPost(true). dialogPage. tokens). Column3).getParameter(EVENT_PARAM))) { String Column1 = (String)row. "DELETE_RECORD_WARN". java.getAttribute("Column2"). Column1).getMessage("AK".WARNING. if ("delete". } 8. import oracle. OAException.getAttribute("Column2").framework. null). Congratulation you have successfully finished.. am.fnd.putDialogMessage(message).io. String Column2 = (String)row. else if (pageContext.getApplicationModule(webBean).Serializable. AppsLead.invokeMethod("deleteRecord". pageContext.CONFIRMATION. parameters). Run Your page and Test Your Work Copyright © 2013. null.getAttribute("Column1").apps. Serializable[] parameters = { Column1 }. OAException message = new OAException("FND". All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 import java. OAApplicationModule am = pageContext.. "DELETE_CONFIRM".OAApplicationModule.getParameter("DeleteYesButton") != null) { String Column1 = (String)row. . All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. AppsLead. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . AppsLead. ---------------------.---------------------last_update_date DATE NOT NULL. AppsLead. Copyright © 2013.MasterdetailDemoAM Package -.prajkumar.fnd. Create a New OA Workspace and Empty OA Project File> New > General> Workspace Configured for Oracle Applications File Name -. -.server Check Generate JavaFile(s) 3.MasterDetailProj Project Name – MasterDetailDemo Default Package -.Master Table CREATE TABLE master_table_demo ( -.Data Columns -.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Implement Master Detail Relationship in OAF Page Let us try to implement Master Detail Relationship in advanceedTable.Who Columns -. Lets Create two tables -. Both have relationship with each other with Column1 (Note .masterdetaildemo.masterdetaildemo 2. Create Application Module AM MasterDetailDemo right click > New > ADF Business Components > Application Module Name -.apps. All rights reserved .oracle. Column2 VARCHAR2(100).prajkumar. We need two tables one table will be act as Master table and second table will be act as Child or detail table.oracle.Column1 is a primary key in both tables) 1.--------------------Column1 VARCHAR2(100). We will create two tables master table and child table.fnd.apps.----------------------. ---------------------last_update_date DATE NOT NULL. created_by NUMBER NOT NULL. -. INSERT INTO master_table_demo VALUES ( ‘VAL3’. 0. NOT NULL. SYSDATE. 0. SYSDATE. Note – Consider Master Table is Linked to Detail Table with Column1 NUMBER DATE NUMBER NUMBER NOT NULL. 0.Who Columns -.----------------------. last_updated_by NUMBER NOT NULL. last_update_login NUMBER ). 0. All rights reserved .Insert Data into Master Table INSERT INTO master_table_demo VALUES ( ‘VAL1’. NOT NULL. AppsLead. ‘VAL2’. ‘VAL6’. 0.Detail Table CREATE TABLE detail_table_demo ( -. 4. SYSDATE. SYSDATE. INSERT INTO detail_table_demo VALUES ( ‘VAL3’. SYSDATE. ‘VAL4’.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 last_updated_by creation_date created_by last_update_login ). Column2 VARCHAR2(100). -. -. creation_date DATE NOT NULL. 0). 0. 0). 0).--------------------Column1 VARCHAR2(100).---------------------. Copyright © 2013. Lets put some data in the tables -. ‘VAL8’. SYSDATE. 0.Insert Data into Detail Table INSERT INTO detail_table_demo VALUES ( ‘VAL1’.Data Columns -. SYSDATE. schema. 5.fnd. Create a New Entity Object (EO) for Detail Table Copyright © 2013. All rights reserved .prajkumar. 0).oracle. Create Method.master_table_demo Note -.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 SYSDATE.masterdetaildemo.server Database Objects -. AppsLead.Make Column1 as a primary key Check the Accessors. 0. Validation Method and Remove Method 6. Create a New Entity Object (EO) for Master Table Right click on MasterDetailDemo > New > ADF Business Components > Entity Object Name – MasterEO Package -.apps. schema. AppsLead. Validation Method and Remove Method Note – Column1 in both tables is common Column to make parent child relationship 7.apps. All rights reserved . Create Method.masterdetaildemo. Lets Create View Object for Master Table Copyright © 2013.oracle.detail_table_demo Note -.prajkumar.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Right click on MasterDetailDemo > New > ADF Business Components > Entity Object Name – DetailEO Package -.Make Column1 as a primary key Check the Accessors.fnd.server Database Objects -. masterdetaildemo. DetailFlag and shuttle them to selected list In Java page deselect Generate Java file for View Object Class: MasterVOImpl 8. Lets Create View Object for Detail Table Right click on MasterDetailDemo > New > ADF Business Components > View Copyright © 2013. Column2.MasterVO Package -.oracle. All rights reserved .fnd.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Right click on MasterDetailDemo > New > ADF Business Components > View Object Name -.prajkumar.server In Step2 in Entity Page select MasterEO and shuttle them to selected list Create transient item by clicking on New Name – DetailFlag Type -.Boolean In Step3 in Attributes Window select columns Column1. AppsLead.apps. AppsLead.oracle.apps.apps.server In Step2 in Entity Page select DetailEO and shuttle them to selected list In Step3 in Attributes Window select columns Column1.prajkumar. Column2 and shuttle them to selected list In Java page deselect Generate Java file for View Object Class: DetailVOImpl 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 -. All rights reserved .masterdetaildemo.prajkumar.fnd.oracle.DetailVO Package -.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Object Name -.fnd.masterdetaildemo.server Copyright © 2013. AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 10. All rights reserved . DetailVO via ViewLink. DetailVO and shuttle to Data Model list Copyright © 2013. Add Your View Object to Root UI Application Module Right click on MasterdetailDemoAM > Application Modules > Data Model > Select MasterVO. fnd. AppsLead.apps. Select MasterdetailDemoPG and go to the strcuture pane where a default region has been created 13.prajkumar. Select region1 and set the following properties: ID -.PageLayoutRN Copyright © 2013.webui 12. All rights reserved .masterdetaildemo.oracle.MasterdetailDemoPG Package -.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 11. Create a New Page Right click on MasterdetailDemo > New > Web Tier > OA Components > Page Name -. fnd. Create Columns and their items for MainTableRN Create Column1 Select MainTableRN > New > column Select column1 > New > Item ID – item1 Item Style – messageStyledText View Attribute – Column1 Copyright © 2013.server.MasterdetailDemoVL1 Width – 100% Rendered – True 16.masterdetaildemo.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Region Style -.MasterdetailDemoAM Window Title – Master Detail Demo Page Window Title – Master Detail Demo Page Header Auto Footer – True 14.apps.oracle. AppsLead.PageLayout AM Definition -prajkumar.MainRN Region Style – header 15. Add a New Region MainRN Select PageLayoutRN right click > New > Region ID -.advancedTable View Instance -. All rights reserved .Column1 View Link Instance -. Create a Master Table Region Select MainRN > New > Region ID – MainTableRN Region Style -.MasterVO1 Detail View Attribute – DetailFlag Child View Attribute -. Create a Detail Region Select MainTableRN > New > detail A new Region will be get created under detail set following properties for that region ID – DetailRN Region Style – header 18. All rights reserved .DetailVO2 View Link Instance -. Create a DetailTable Region Select DetailRN > New > Region For New region set following Properties ID – DetailTableRN Region Style – advancedTable View Instance -. Create Columns and their items for DetailTableRN Create Column3 Select DetailTableRN > New > column Select column3 > New > Item ID – item3 Copyright © 2013.MasterdetailDemoVL1 Width – 100% Rendered – True 19.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Create Column2 Select MainTableRN > New > column Select column2 > New > Item ID – item2 Item Style – messageStyledText View Attribute – Column2 17. AppsLead. OAWebBean.fnd.webui.MasterdetailDemoAMImpl .prajkumar. .MasterdetailDemoCO Set Following Code in CO import oracle.masterdetaildemo. Add Controller for Page MasterdetailDemoPG Select PageLayoutRN right click Set New Controller Package Name -. All rights reserved .webBean). AM..framework.apps.fnd.webui.beans.MasterDetails(pageContext. } Copyright © 2013.server.processRequest(pageContext. pageContext.writeDiagnostics(this.fnd.webui Class Name -. webBean)..oracle.apps. import oracle.fnd. import prajkumar.oracle.masterdetaildemo. OAWebBean MasterdetailDemoAMImpl AM = (MasterdetailDemoAMImpl)pageContext.getApplicationModule(webBean). public void processRequest(OAPageContext pageContext.apps.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Item Style – messageStyledText View Instance – DetailVO2 View Attribute – Column1 Create Column4 Select DetailTableRN > New > column Select column4 > New > Item ID – item4 Item Style – messageStyledText View Instance – DetailVO2 View Attribute – Column2 20. AppsLead.framework.OAPageContext. webBean) { super. 1).apps. "Calling Method". Add Following Code (MasterdetailDemoAMImpl.fnd. .OAWebBean. AppsLead.webui.executeQuery(). import oracle. All rights reserved ..beans.fnd.webui.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 21.. public void MasterDetails(OAPageContext webBean) { MasterVOImpl pvo = getMasterVO1(). } pageContext.OAWebBean 22. pvo.apps.apps.framework.java) in your AMImpl Class import oracle.OAPageContext.framework. Final Structure pane will look like following picture Copyright © 2013. AppsLead. All rights reserved . Congratulation you have successfully Your MasterdetailDemoPG page and Test Your Work finished. Run Copyright © 2013.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 23. AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . apps.oracle. AppsLead. Create a New View Object (VO) Right click on KFFDemo > New > ADF Business Components > View Object Name -.kffdemo. Name the project as KFFDemo and package as prajkumar.kffdemo 2.server Check Application Module Class: KFFAMImpl Generate JavaFile(s) 3.server Note .kffdemo.fnd.KFFVO Package -.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Key Flex Fields.oracle.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 4. All rights reserved .KFFAM Package -. KFF in OAF 1.fnd. Create a New Application Module (AM) Right Click on KFFDemo > New > ADF Business Components > Application Module Name -.oracle. Automatically a new OA Project will also be created.prajkumar.prajkumar.fnd. Create a New Workspace and Project Right click Workspaces and click create New OA Workspace and name it as PRajkumarKFFDemo.apps.apps. Add View Object to Root UI Application Module Right Click on KFFAM > Edit KFFAM > Data Model and shuttle KFFVO from Available View Objects to Data Model Copyright © 2013. apps. All rights reserved .KFFAM Key Flex Field Demo Window Key Flex Field Demo 8. AppsLead.prajkumar.kffdemo.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 5. Create Stack Layout Region Under Page Layout Region Right click PageLayoutRN > New > Region Attribute ID AM Definition Property MainRN stackLayout 9.KFFPG Package -.oracle.webui 6. Create a New Page Right click on KFFDemo > New > Web Tier > OA Components > Page Name -.fnd. Select the KFFPG and go to the strcuture pane where a default region has been created 7. Create a New Item of type Flex under the Stack Layout Region Copyright © 2013. Select region1 and set the following properties: Attribute ID AM Definition Window Title Title Property PageLayoutRN prajkumar.kffdemo.server.fnd.apps.oracle. OAWebBean webBean) { super.webui Class Name: KFFCO Write Following Code in KFFCO processRequest public void processRequest(OAPageContext pageContext.kffdemo. webBean).fnd. // Set the code combination lov kffId.oracle. Copyright © 2013. Create Controller for page KFFPG Right Click on PageLayoutRN > Set New Controller Package Name: prajkumar. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Right click on MainRN > New > Item Set Following Properties for New Item -- Attribute ID Item Style Prompt Property KeyFlexItem Flex Accounting Key Flex Field Appl Short Name SQLGL Name Type View Instance GL# Key KFFVO1 10. OAKeyFlexBean kffId = (OAKeyFlexBean)webBean. AppsLead.apps.useCodeCombinationLOV(true).processRequest(pageContext.findIndexedChildRecursive("KeyFlexItem"). if(!vo.flex_value_set_id FROM fnd_id_flexs fif. //Execute the Query KFFAMImpl am = (KFFAMImpl)pageContext. fif. AppsLead. fnd_id_flex_segments fifse WHERE fif. fifse.segment_name.segment_num.id_flex_num Copyright © 2013. fifse.isPreparedForExecution()) { vo. KFFVOImpl vo = (KFFVOImpl)am.application_table_name.application_id.description.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 //set the structure code for the item key flex kffId.id_flex_name.application_id AND fif. All rights reserved .id_flex_structure_code.setStructureCode("FED_AFF").executeQuery().id_flex_code AND fifse.id_flex_num.id_flex_code = fif.application_id = fifs. 11.id_flex_code. fifse.setCCIDAttributeName("CodeCombinationId").application_id = fif.id_flex_code = fifs.useCodeCombinationLOV(false). fnd_id_flex_structures fifs.findViewObject("KFFVO1"). fifs.id_flex_num = fifs. fif. Use the below Query to find the Structure Code SELECT fif.application_id AND fifse. fifs. //Set the attribute name to the item kffId. } } 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.getApplicationModule(webBean).id_flex_code AND fifse. fif. fif. id_flex_name LIKE 'GL#' LIKE 'Accounting Flexfield'.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 AND AND fif.id_flex_code fif. All rights reserved . Congratulation you have successfully finished. Run Your page and Test Your Work Copyright © 2013. 12. AppsLead. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. AppsLead. apps.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Implement Dependent LOV in OA Framework Let us try to create a Dependent LOV. AppsLead. Right Click on DependentLovDemo > Oracle Applications > Run Options.dependentlovdemo Note -.oracle. Name the project as DependentLovDemo and package as prajkumar.fnd. All rights reserved .Check Run Option Property for Project. Check OADeveloperMode should not be inSelected Options if it is there in Selected Options list then shuttle it back to Available Options Copyright © 2013. Create a New Workspace and Project Right click Workspaces and click create new OAworkspace and name it as PRajkumarDependentLovDemo. Automatically a new OA Project will be created. In this exercise first Lov Input is “Employee Name” based on Employee Name Second Lov Input will give “Dependent Name” 1. Create a New Application Module (AM) Right Click on DependentLovDemo > New > ADF Business Components > Application Module Name -.dependentlovdemo.apps.dependentlovdemo.oracle.prajkumar. AppsLead.fnd.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 2.server Copyright © 2013.server 3. All rights reserved .prajkumar.oracle.DependentLovAM Package -.fnd.apps. Create a New View Object (VO) Right click on DependentLovDemo > New > ADF Business Components > View Object Name – DependentLovVO1 Package -. per_all_people_f papf WHERE papf.server Note .contact_person_id AND SYSDATE BETWEEN pcr.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Note .person_id.The VO is not based on any EO so click next and go to the query section and paste the query SELECT pcr. Add Your View Objects to Root UI Application Module Select Right click on DependentLovAM > Edit DependentLovAM > Data Model > Select DependentLovVO1 and DependentLovVO2 and shuttle to Data Model list Copyright © 2013.SYSDATE) AND SYSDATE BETWEEN papf.prajkumar.oracle.date_end. Create a New View Object for Second Lov (VO) Right click on DependentLovDemo > New > ADF Business Components > View Object Name – DependentLovVO2 Package -. full_name FROM per_all_people_f WHERE SYSDATE BETWEEN effective_start_date AND effective_end_date 4. papf.date_start AND NVL(pcr.person_id = pcr. AppsLead.apps.dependentlovdemo.full_name FROM per_contact_relationships pcr.The VO is not based on any EO so click next and go to the query section and paste the query SELECT person_id.effective_end_date 5.fnd. All rights reserved .effective_start_date AND papf. webui Region Style -.FirstLovRN Package -.listOfValues Scope -.prajkumar.oracle.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Create First LOV Region for VO DependentLovVO1 6.dependentlovdemo.fnd. AppsLead.The property Scope is the key property which makes the LOV region Copyright © 2013. All rights reserved .Public Note .apps. Create First LOV Region Right click on DependentLovDemo > New > Web Tier > OA Components > Region Name -. DependentLov AM and select DependentLovVO1_1. All rights reserved .oracle. AppsLead.fnd. Click Next Region Id – FirstLovRN Region style – table Copyright © 2013.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 public and makes it usable in multiple pages 7.dependentlovdemo.apps.server. Right click on FirstLovRN and click table using wizard. In the wizard choose the prajkumar. That is PersonId and FullName Copyright © 2013. All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 8. Shuttle the two attributes to the right side. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 9. Set Region Item properties as below – ID PersonId_LOV FullName_LOV Prompt PersonId FullName Style formValue messageStyledText Datatype NUMBER VARCHAR2 Copyright © 2013, AppsLead. All rights reserved Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 10. Click Next and Finish 11. Select PersonId_LOV and Set Following Properties – Attribute Search Allowed Selective Search Criteria Property False False 12. Select FullName_LOV and Set Following Properties – Attribute Search Allowed Property True Copyright © 2013, AppsLead. All rights reserved Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Selective Search Criteria False Now Same way Create Second LOV Region for VO DependentLovVO2 13. Create Second LOV Region Right click on DependentLovDemo > New > Web Tier > OA Components > Region Name -- SecondLovRN Package -- prajkumar.oracle.apps.fnd.dependentlovdemo.webui Region Style -- listOfValues Scope -- Public 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.DependentLov AM and select DependentLovVO2_1. Click Next Copyright © 2013, AppsLead. All rights reserved Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Region Id – SecondLovRN Region style – table Copyright © 2013, AppsLead. All rights reserved Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 15. Shuttle the two attributes to the right side.That is PersonId and FullName Copyright © 2013, AppsLead. All rights reserved All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 16. AppsLead. Set Region Item properties as below – ID Prompt Style Datatype Second_PersonId_LOV PersonId Second_FullName_LO V FullName messageStyledText NUMBER messageStyledText VARCHAR2 Copyright © 2013. All rights reserved . Select Second_PersonId_LOV and Set Following Properties – Attribute Search Allowed Selective Search Criteria Property False True 19. Select Second_FullName_LOV and Set Following Properties – Attribute Search Allowed Property True Copyright © 2013. AppsLead. Click Next and Finish 18.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 17. Select region1 and set the following properties: Attribut e ID Property PageLayoutRN AM prajkumar.oracle.oracle.fnd. All rights reserved .fnd. Select the DependentLovPG and go to the strcuture pane where a default region has been created 22.DependentL Definition ovAM Window Title Title Dependent List of values Demo Window Dependent List of values Demo 23.dependentlovdemo.webui 21. Create a New Page Right click on DependentLovDemo > New > Web Tier > OA Components > Page Attribute Name Package Property DependentLovPG prajkumar.apps. AppsLead.dependentlovdemo.server.apps. Right click PageLayoutRN and click new Region Copyright © 2013.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Selective Search Criteria False 20. Right click the MainRN and click new messageLovInput Set Following Properties for Newly Created messageLovInput Attribute ID External Lov Search Allowed Selective Search Criteria Property Employee_Name /prajkumar/oracle/apps/fnd/dependentlovdemo/webui/FirstLovRN False True Copyright © 2013.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Attribute ID Region Style Property MainRN messageComponentLayout 24. AppsLead. 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 ID Item Style Data Type Property ParentPersonId formValue Number Build First LOV on Page: 25. All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Prompt Employee Name Select LovMap1 and set following properties -- Attribute Lov Region Item Return Item Criteria Item Property FullName_LOV Employee_Name Employee_Name Create LovMap2 and set following properties for that -Select Employee_Name > lovMappings right click New > lovMap Set following properties for lovMap2 -- Attribute Lov Region Item Return Item Property PersonId_LOV ParentPersonId Build Second LOV on Page: 26. All rights reserved . Right click the MainRN and click new messageLovInput Set Following Properties for Newly Created messageLovInput Attribute ID External Lov Property Dependent_Name /prajkumar/oracle/apps/fnd/dependentlovdemo/webui/SecondLovRN Copyright © 2013. All rights reserved . AppsLead. Congratulation you have successfully finished. Run Your page and Test Your Work Copyright © 2013.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Search Allowed Selective Search Criteria Prompt True True Dependent Name Select LovMap3 and set following properties -- Attribute Lov Region Item Return Item Programmatic Query Property Second_FullName_LOV Dependent_Name True Create LovMap4 and set following properties for that -Select Dependent_Name > lovMappings right click New > lovMap Set following properties for lovMap4 -- Attribute Lov Region Item Criteria Item Required Property Second_PersonId_LOV ParentPersonId True 27. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. AppsLead. AppsLead. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . Create a New Page Right click on LovDemo > New > Web Tier > OA Components > Page Name -.fnd.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Implement External LOV in OA Framework 1. Create a New View Object (VO) Right click on LovDemo > New > ADF Business Components > View Object Name -. full_name per_all_people_f WHERE SYSDATE BETWEEN effective_start_date AND effective_end_date 4.fnd.server Note .lovdemo.The VO is not based on any EO so click next and go to the query section and paste the query SELECT FROM employee_number.prajkumar. Create a New Workspace and Project Right click Workspaces and click create new OAworkspace and name it as PRajkumarLovDemo.oracle. Automatically a new OA Project is also created. Add View Object to Root UI Application Module 5.prajkumar.LovAM Package -.apps.webui Copyright © 2013.apps.oracle.prajkumar.apps. All rights reserved .fnd. Name the project as LovDemo and package as prajkumar.oracle.apps.lovdemo.fnd.LovPG Package -.oracle.lovdemo. Create a New Application Module (AM) Right Click on LovDemo > New > ADF Business Components > Application Module Name -.lovdemo 2.LovVO Package -.server 3. AppsLead. oracle. Select EmployeeLovRN. Create a New Region Right click on LovDemo > New > Web Tier > OA Components > Region Name -.fnd. Select region1 and set the following properties: ID -.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 6.oracle.oracle.MainRN Region Style – messageComponentLayout Note .LovRN Region style -.LovAM and select the LovVO1.apps. In the wizard choose the prajkumar.lovdemo.table Copyright © 2013.Public Note .apps.server .listOfValues Scope -.PageLayoutRN AM Definition -. AppsLead. Right click PageLayoutRN and click new Region ID -.webui Region Style -.Style is given as messageComponentlayout because we are going to create only message components that is messageLovInput item in that region 9.List of values Demo Window Title – List of values Demo 8.lovdemo.apps.server.fnd.The property Scope is the key property which makes the LOV region public and makes it usable in multiple pages 10.LovAM Window Title -.prajkumar.lovdemo.fnd. All rights reserved . Click Next Region Id -. Select the LovPG and go to the strcuture pane where a default region has been created 7. Right click on EmployeeLovRN in Structure pane and click table using wizard.EmployeeLovRN Package -.prajkumar. That is EmployeeNumber and FullName 12.Employee Name 15. Shuttle the two attributes to the right side./prajkumar/oracle/apps/fnd/lovdemo/webui/EmployeeLovRN Lov Region Item -. Click on LovPG and right click the MainRN and click new messageLovInput External Lov -.item1 Prompt -.FullName Return Item -. Congratulation you have successfully finished.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 Attaching External LOV to Page: 14. AppsLead. Select the field FullName and set the following properties: Search Allowed -. Click next. Run Your page and Test Your Work Copyright © 2013.True Selective Search Criteria – True Note . All rights reserved . check the mapping and then finish 13.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 11.item1 Criteria Item -. AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. Create a OA components Page Right click on SetDefaultProj > New > Web Tier > OA Components > Page Name -.fnd. AppsLead.SetDefaultPG Package -.SetDefaultAM Package -.prajkumar.prajkumar.setdefaultproj. Create a New OA Workspace and Empty OA Project File > New > General > Workspace Configured for Oracle Applications File Name – PrajkumarSetDefaultValDemo Automatically a new OA Project will also be created Project Name -.setdefaultproj 2.apps.prajkumar.webui 4. Select region1 and set the following properties: Attribute ID Property PageLayoutRN Copyright © 2013.oracle.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Set Default Value for messageTextInput in OAF 1.oracle.apps.fnd.apps. All rights reserved .server Check Application Module Class: SetDefaultAMImpl Generate JavaFile(s) 3. Select SetDefaultPG and go to the strcuture pane where a default region has been created 5.SetDefaultProj Default Package -. Create Application Module AM Right Click on SetDefaultProj > New > ADF Business Components > Application Module Name -.setdefaultproj.fnd.oracle. fnd. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Region Style Form Property Auto Footer Window Title Title AM Definition pageLayout True True Set Default Value Window Title Set Default Value Header prajkumar.setdefaultproj. Create messageTextInput MainRN > New > messageTextInput Attribute ID Style Property Length Maximum Length Property MyTextitemId messageTextInput 20 50 8.SetDefaultAM 6.oracle.apps. AppsLead. Create the Second Region Right click on PageLayoutRN > New > Region Attribute ID Region Style Property MainRN messageComponentLayout 7. Save Your Work Copyright © 2013. OAMessageTextInputBean textBean = (OAMessageTextInputBean)webBean. myValue).apps.setdefaultvaldemo. String myValue = "My Default Value". Test Your Work Copyright © 2013.webui. Add a Controller MainRN > Set New Controller Package Name -.SetDefaultValCO 10.message. } 11. AppsLead. Edit Your Controller Add Following Code in processRequest import oracle.processRequest(pageContext.fnd.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 9.webui Class Name -.OAMessageTextInp utBean. public void processRequest(OAPageContext pageContext.oracle.beans.prajkumar.apps. OAWebBean webBean) { super.setValue(pageContext. textBean.findChildRecursive("MyTextite mId"). All rights reserved .framework. webBean).fnd. All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. Create a New Page Right click on PopListDemo > New > Web Tier > OA Components > Page Name -.oracle.apps.prajkumar.poplistdemo 2.The VO is not based on any EO so click next and go to the query section and paste the query SELECT FROM UNION SELECT FROM UNION SELECT FROM 'poplist_item1' poplist_items DUAL 'poplist_item2' DUAL 'poplist_item3' DUAL 4.fnd.server Note .poplistdemo.oracle. Create a New View Object (VO) Right click on PopListDemo > New > ADF Business Components > View Object Name -.oracle.fnd. Create a New Workspace and Project File> New > General> Workspace Configured for Oracle Applications File Name -.poplistdemoPG Copyright © 2013.server 3.fnd. All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Implement PopList in OA Framework 1.apps.prajkumar. Create a New Application Module (AM) Right Click on PopListDemo > New > ADF Business Components > Application Module Name -.poplistdemoVO Package -.PopListDemo Project Name – PopListDemo Default Package -.poplistdemo.apps.prajkumar.poplistdemoAM Package -. webui 5.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Package -.apps.poplist_items Copyright © 2013.Yes Picklist View Definition -prajkumar.fnd. Select the poplistdemoPG and go to the strcuture pane where a default region has been created 6.prajkumar.oracle.MainRN Region Style – messageComponentLayout 8.oracle.PopList Demo Window Title – PopList Demo Header 7.PageLayoutRN AM Definition -. Create the first Item (Empty Field) MainRN > New > messageChoice Set following properties for new item ID – MyPopList Required -.poplistdemo.server. Select region1 and set the following properties: ID -. Right click PageLayoutRN and click new Region ID -. Verify Your VO attribute name Select poplistdemoVO right click > Edit poplistdemoVO > Attributes > Verify the Name it should be “poplist_items” if it is not then edit it and enter name “poplist_items” 9.apps.apps. All rights reserved .fnd.poplistdemoAM Window Title -.poplistdemoVO Picklist Display Attribute – poplist_items (Name of Attribute in Your VO) Picklist Value Attribute -. AppsLead.poplistdemo.fnd.server.prajkumar.oracle.poplistdemo. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 CSS Class – OraFieldText Prompt – My PopList 10. Run Your page and Test Your Work Copyright © 2013. Congratulation you have successfully finished. All rights reserved . AppsLead. fnd.prajkumar. AppsLead.PPRAM Package -. Create Application Module AM PPRDemoProj right click > New > ADF Business Components > Application Module Name -.fnd. All rights reserved .pprdemo.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Partial Page Rendering in OAF Page Let us try to implement partial page rendering for a text item. If value of TextItem1 is null then TextItem2 will not be appreared on UI.oracle. If value of TextItem1 is not null then TextItem2 will be appreared on UI.oracle. Create a PPRVO View Object PPRDemoProj> New > ADF Business Components > View Objects Name – PPRVO Package – prajkumar.fnd. Create a New OA Workspace and Empty OA Project File> New > General> Workspace Configured for Oracle Applications File Name -.PPRProj Project Name – PPRDemoProj Default Package -.prajkumar.pprdemo 2. 1.apps.apps.pprdemo.apps.oracle.server In Attribute Page Click on New button and create transient primary key attribute with the following properties: Attribute Property Copyright © 2013.server Check Application Module Class: PPRAMImpl Generate JavaFile(s) 3. Modify the Page Layout (Top-level) Region Copyright © 2013.webui 6. Add Your View Object to Root UI Application Module Right click on PPRAM > Edit PPRAM > Data Model > Select PPRVO in Available View Objects list and shuttle to Data Model list 5.fnd.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Name Type Updateable Key Attribute RowKey Number Always (Checked) Click New button again and create transient attribute with the following properties: Attribute Name Type Updateable Property TextItem2Render Boolean Always Note – No Need to generate any JAVA files for PPRVO 4.apps.prajkumar.pprdemo. Create a OA components Page PPRDemoProj right click > New > OA Components > Page Name – PPRPG Package -. All rights reserved .oracle. AppsLead. pprdemo.apps.PPR AM 7.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Attribute ID Region Style Form Property Auto Footer Window Title Title AM Definition Property PageLayoutRN pageLayout True True PPR Demo Window Title True PPR Demo Page Header prajkumar.server.fnd. All rights reserved . Create the Second Region (Main Content Region) Right click on PageLayoutRN > New > Region Attribute ID Region Style Property MainRN messageComponentLayout 8.oracle. AppsLead. Create Two Text Items Create First messageTextItem -Right click on MainRN > New > messageTextInput Attribute ID Property TextItem1 Copyright © 2013. Add Following code in PPRAMImpl. All rights reserved .java Copyright © 2013. AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Region Style Prompt Length Disable Server Side Validation Disable Client Side Validation Action Type Event Submit messageTextInput Text Item1 20 True True firePartialAction TextItem1Change True Note -.PPRVO1.TextItem2Render} 9.Disable Client Side Validation and Event property appears after you set the Action Type property to firePartialAction Create Second messageTextItem -Select MainRN right click > New > messageTextInput Attribute ID Region Style Prompt Length Rendered Property TextItem2 messageTextInput Text Item2 20 ${oa. apps. Implement Controller for Page Select PageLayoutRN in Structure pane right click > Set New Controller Package Name -. oracle.fnd.framework.prajkumar.fnd.apps.framework.oracle.framework. webBean).OAViewObject. } } } 10.executeQuery(). if (vo != null) { if (vo. public void handlePPRAction() { Number val = 1. Copyright © 2013.apps.setMaxFetchSize(0). vo. Boolean.framework.OAViewObject.setAttribute("RowKey". All rights reserved . OAViewObject vo = (OAViewObject)findViewObject("PPRVO1").framework.apps.fnd.OAApplicationModuleImpl. row.framework. oracle.OARow.setAttribute("TextItem2Render".OAViewObjectImpl.fnd.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 import import import import oracle. val). AppsLead. row.createRow()). import oracle.server. vo. OAWebBean webBean) { super.fnd.processRequest(pageContext. public void processRequest(OAPageContext pageContext.server.insertRow(vo.first().pprdemo.OARow.FALSE). OARow row = (OARow)vo.apps. oracle.fnd.getFetchedRowCount() == 0) { vo.apps.webui Class Name – PPRCO Write following code in processFormRequest function of PPRCO Controller import oracle.apps.fnd. am. OAViewObject vo = (OAViewObject)am. PPRAMImpl am = (PPRAMImpl)pageContext.setAttribute("TextItem2Render". } else { row. } } } 11. Boolean.invokeMethod("handlePPRAction"). webBean).getApplicationModule(webBean).FALSE). Congratulation you have successfully finished.findViewObject("PPRVO1").TRUE).setAttribute("TextItem2Render".processFormRequest(pageContext. All rights reserved . OARow row = (OARow)vo. } public void processFormRequest(OAPageContext pageContext.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 PPRAMImpl am = (PPRAMImpl)pageContext. if ("TextItem1Change".getApplicationModule(webBean).equals(pageContext. OAWebBean webBean) { super. AppsLead.getParameter("TextItem1").getParameter(EVENT_PARAM))) { if (pageContext. Boolean.equals("")) { row. Run Your PPRPG page and Test Your Work Copyright © 2013.getCurrentRow(). All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. Create a New Page Right click on ParameterizedProcProj > New > Web Tier > OA Components > Page Name -.PageLayout AM Definition --prajkumar.ParameterizedProcDemoPG Package -.oracle.apps.fnd.prajkumar.parameterizedprocdemo 2.server Check Application Module Class: ParameterizedProcDemoAMImpl Generate JavaFile(s) 3.ParameterizedPro cDemoAM Copyright © 2013.oracle. Create a New OA Workspace and Empty OA Project File> New > General> Workspace Configured for Oracle Applications File Name -.prajkumar.PageLayoutRN Region Style -.apps.apps.fnd.server.ParameterizedProcDemoAM Package -.prajkumar. AppsLead.apps. We will try to send two interger values to one PL/SQL procedure which will do sum of that numbers and will return back sum of that numbers 1.ParameterizedProcProj Project Name – ParameterizedProcDemo Default Package -.parameterizedprocdemo. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Execute parameterized PL SQL procedure from OAF page Let us try to call PL/SQL package from OAF page.fnd.oracle.fnd.oracle. Create Application Module AM Right click on ParameterizedProcProj > New > ADF Business Components > Application Module Name -.parameterizedprocdemo.webui 4. Select region1 and set the following properties: ID -.parameterizedprocdemo. Number Prompt – Text Item1 Maximum Length – 20 Length -. AppsLead.Number Prompt – Text Item2 Maximum Length – 20 Copyright © 2013. Add a New Region MainRN Select PageLayoutRN right click > New > Region ID -.20 Create item2 Select MainRN > New > messageTextInput Set following Properties for Text Item1 ID – item2 Item Style – messageTextInput Data Type -.MainRN Region Style – messageComponentLayout 6. All rights reserved . Create messageTextInput Items Create item1 Select MainRN > New > messageTextInput Set following Properties for Text Item1 ID – item1 Item Style – messageTextInput Data Type -.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Window Title – Execute Paramterized Procedure Demo Page Window Title – Execute Paramterized Procedure Demo Page Header Auto Footer – True 5. AppsLead.test_package AUTHID CURRENT_USER Copyright © 2013. Create a Submit Button Right Click on MainRN > New > messageLayout Select newly created messageLayout right click > New > item Set Following Properties for newly created item ID – Sum Item Style – submitButton Attribute Set -. Run Your Page UI is ready -- 9./oracle/apps/fnd/attributesets/Buttons/Go Prompt – Sum 8. Let us create a package and package body which we will call from OAF page This Package takes three parameters all are number.20 7. First two are IN parameters and last is OUT as sum of first two numbers Package Spec CREATE OR REPLACE PACKAGE APPS.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Length -. All rights reserved . OAException.framework.apps.OADBTransactionImpl.server. EXIT.fnd. 10.OADBTransaction. item2 IN NUMBER.fnd. public String dataSumAction(String item1. / SHOW ERRORS.framework. Copyright © 2013.String item2) { OADBTransaction oadbtransaction = (OADBTransaction)getTransaction(). END test_package.test_package IS PROCEDURE data_sum ( item1 IN NUMBER.sql.OracleCallableStatement.jdbc.fnd.Types. Add Following Code in (ParameterizedProcDemoAMImpl.apps. / SHOW ERRORS. oracle. AppsLead.framework.. END test_package. data_sum OUT NUMBER ) IS BEGIN data_sum := item1 + item2. oracle.server. oracle..Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 IS PROCEDURE data_sum ( item1 IN NUMBER. data_sum OUT NUMBER ). oracle. java. END data_sum. Package Body CREATE OR REPLACE PACKAGE BODY APPS. EXIT.apps. All rights reserved .java) your AMImpl Class import import import import import . item2 IN NUMBER. OracleCallableStatement oraclecallablestatement = (OracleCallableStatement)oadbtransaction. String retValues.oracle.append( " item1 => :1. retValues = oraclecallablestatement. Types. str. Add Controller for Page ParameterizedProcDemoPG PageLayoutRN right click Set New Controller Select Package Name -.ParameterizedProcDemoCO Add Following Code in Controller import oracle. oraclecallablestatement.parseInt(item1) ).fnd. import java.setInt(1. 1).Serializable. } = 11. Integer.setInt(2.wrapperException(e).append( " data_sum => :3 ").execute().append( " BEGIN ").createCallableStatement(str.OAApplicationModule. str. Copyright © 2013.apps. oraclecallablestatement. str.webui Class Name -. ").append( " test_package. str. StringBuffer str = new StringBuffer().fnd. AppsLead.append( " item2 => :2. str.append( " ). try{ oraclecallablestatement.VARCHAR).parseInt(item2) ).getString(3).Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 OADBTransactionImpl oadbtransactionimpl (OADBTransactionImpl)getTransaction(). } return retValues.framework.registerOutParameter(3. str. import oracle.fnd.data_sum( ").io. ").OAException.toStr ing(). ").parameterizedprocdemo.prajkumar.append( " END.apps.framework. Integer. str.apps. } catch(Exception e) { throw OAException. "). oraclecallablestatement. All rights reserved . OAWebBean webBean) { super.. throw new OAException(message. pageContext..getParameter("item1"). Congratulation you have successfully finished. webBean). AppsLead. parameters1). Your ParameterizedProcDemoPG page and Test Your Work Run Copyright © 2013.processFormRequest(pageContext.getApplicationModule(webBean). OAException.invokeMethod("dataSumAction". }. if (pageContext. OAApplicationModule am = pageContext. } } 12. String retVals1 = (String)am.getParameter("Sum") != null) { Serializable[] parameters1 = { pageContext. public void processFormRequest(OAPageContext pageContext.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 . String message = "Sum: " + retVals1.INFORMATION). All rights reserved .getParameter("item2"). Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. AppsLead. All rights reserved . Consider three pages each having Text Item 1.prajkumar. TrainDemoPG2 and TrainDemoPG3 as similar way as mention below to create TrainDemoPG1 3.fnd.prajkumar.traindemo.apps. Create a New OA Workspace and Empty OA Project File> New > General> Workspace Configured for Oracle Applications File Name -.apps. Modify the Page Layout (Top-level) Region Attribute ID Region Style Property PageLayoutRN pageLayout Copyright © 2013.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Implement Train in OAF Page Let us try to implement train between three pages.webui 4. Create Application Module AM TrainDemoProj right click > New > ADF Business Components > Application Module Name -.TrainDemoAM Package -.oracle.oracle.TrainProj Project Name – TrainDemoProj Default Package -.fnd.oracle.traindemo. All rights reserved .server Check Generate JavaFile(s) Create Three Pages TrainDemoPG1.traindemo 2. Create a OA components Pages TrainDemoProj right click > New > OA Components > Page Name – TrainDemoPG1 Package -.fnd.apps. AppsLead.prajkumar. server.apps. TrainDemoPG2 and TrainDemoPG3 in similar way of as mention below to create TextItemPage1 in page TrainDemoPG1 6.20 7. Create a Standalone Train Region TrainDemoProj > New > Web Tier > OA Components > Region Name -. Create Text Items Select MainRN right click > New > messageTextInput Prompt – TextItemPage1 Length -.webui Copyright © 2013.oracle. TextItemPage2 and TextItemPage3 in respective pages TrainDemoPG1.TrainDem oAM 5.fnd. AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Form Property Auto Footer Window Title Title AM Definition True True Train Demo Window Title Train Demo Page Header prajkumar.traindemo.TrainRN Package – prajkumar.oracle. Create the Second Region (Main Content Region) Select PageLayoutRN right click > New > Region Attribute ID Region Style Property MainRN messageComponentLayout Create Text Items for all three pages say TextItemPage1.apps.fnd. All rights reserved .traindemo. All rights reserved . Add Train Region to each of your Pages For each of three pages in multistep flow.jsp? page=/prajkumar/oracle/apps/fnd/traindemo/webui/TrainDemoPG3 9.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Style – train Select TrainRN inStructure pane and open property inspector and set Allow Interactionproperty to True 8. right click the pageLayoutRN in Copyright © 2013.jsp? page=/prajkumar/oracle/apps/fnd/traindemo/webui/TrainDemoPG2 Right Click on TrainRN in Structure pane > New > Link Set the link properties as follow -ID – TrainStep3 Item Style – link Text – Step 3 Destination URI – OA. AppsLead.jsp? page=/prajkumar/oracle/apps/fnd/traindemo/webui/TrainDemoPG1 Right Click on TrainRN in Structure pane > New > Link Set the link properties as follow -ID – TrainStep2 Item Style – link Text – Step 2 Destination URI – OA. Add Three Train Nodes to TrainRN Right Click on TrainRN in Structure pane > New > Link Set the link properties as follow -ID – TrainStep1 Item Style – link Text – Step 1 Destination URI – OA. Add Links to the navigrationBar Right Click on NavBar > New > link Set Item’s properties as follows: ID – Step1Link Item Style – link Text – Step 1 of 3: Page1 Warn About Changes – False Destination URI -.TrainFooterRN Package -. Create a Standalone (Shared) TrainFooterRN TrainDemoProj > New > Web Tier > OA Components > Region Name -./prajkumar/oracle/apps/fnd/traindemo/webui/TrainDemoPG1 Right Click on NavBar > New > link Copyright © 2013./prajkumar/oracle/apps/fnd/traindemo/webui/TrainRN 10. AppsLead.pageButtonBar 11.traindemo.prajkumar.webui Region Style -. Add navigrationBar Select TrainFooterRN in Structure pane right click > New > Region Set the region properties as follows: ID -.NavBar Region Style – navigationBar First Step – 1 Last Step – 3 12.oracle.fnd. and select New > location from page Context menu Set following properties as follow -ID – TrainDemoRN Extends -.apps. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 structure panel. OAWebBean webBean) { super.prepareForRendering(pageContext).webui.fnd..nav.. import oracle. public void processRequest(OAPageContext pageContext. Copyright © 2013.traindemo.apps.beans./prajkumar/oracle/apps/fnd/traindemo/webui/TrainDemoPG3 13.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Set Item’s properties as follows: ID – Step2Link Item Style – link Text – Step 2 of 3: Page2 Warn About Changes – False Destination URI -.oracle.OANavigationBarBean. Initialize the Footer Region Select TrainFooterRN in Structure pane right click > Set New Controller Class Name -.framework.TrainDemoCO Package Name – prajkumar.fnd.OATrainBean. webBean).webui Add following code in processRequest() import oracle. trainBean./prajkumar/oracle/apps/fnd/traindemo/webui/TrainDemoPG2 Right Click on NavBar > New > link Set Item’s properties as follows: ID – Step3Link Item Style – link Text – Step 3 of 3: Page3 Warn About Changes – False Destination URI -. All rights reserved .nav.beans. AppsLead.getPageLayoutBean().apps.apps.processRequest(pageContext. OATrainBean trainBean = (OATrainBean)pageContext.getLocation().webui.fnd. .framework. right click the PageLayoutRN in Structure pane and select New > Region Set the region’s properties as follow: ID -. AppsLead. Add the Navigation Region to your pages For each of three pages in the multistep flow.PageButtonBar Style -.getSelectedTrainStepRenderedIndex().Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 int step = trainBean. } // end processRequest() 14. All rights reserved .setValue(step+1). Congratulation you have successfully finished.findChildRecursive("NavBar"). navBean./prajkumar/oracle/apps/fnd/traindemo/webui/TrainFooterRN 15. Run Your TrainDemoPG1 page and Test Your Work Copyright © 2013. OANavigationBarBean navBean = (OANavigationBarBean)webBean.pageButtonBar Extends -. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . AppsLead. Hence in this blog.hello. which in this case was oracle.ak.short_name] • hello is the name of your project Step 2 Next.apps. only basics will be discussed.apps.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Oracle D2K to OA Framework Transformation What is the difference between Oracle D2K form and OA Framework? It is a very innocent but important question for someone that desires to make transition from D2K to OA Framework. I hope you have already read and implemented OA Framework Getting Started. means this page represents the Web User Interface You will assign the default AM [OAApplicationModule]. hence the package nameoracle. I had no clue as to what I was doing & why I was doing those steps. I am saying so because this page gets attached to the form function. I will try to explain in simple manner the meaning of OA Framework HelloWorld Program and compare the steps to D2K form [where possible].webui Note the webui. Following key Steps were needed for HelloWorld Step 1 Create a new Workspace and a new Project as dictated by Oracle's tutorial. Think of AM "Connection Manager" and "Transaction State Manager" for your page Copyright © 2013. When I implemented HelloWorld a year ago. AppsLead. When defining project. I will re-visit my own experience of implementing HelloWorld program in "OA Framework". To keep things simple. it is a convention to have page in webui.hello This means the following: • ak is the short name of the Application in Oracle [means fnd_applications. you will specify a default package. • • • This page will be created within hello project. you will create a OA Page within hello project Think OA Page as the fmx file itself in D2K.ak. I merely copied the steps from Oracle Tutorial without understanding them. All rights reserved . Reason being that as soon as you kick off a D2K Form. Think of Canvas in D2K. though processRequest is very restrictive. AppsLead. JDeveloper generates the default code for you. Some examples are if(oapagecontext. for example click of a button. In Framework. Note What is the difference between processRequest and processFormRequest? These two methods are available in the Default Controller class that gets created. You can have nested regions.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 I can't co-relate this to anything in D2k. processFormRequest This method is commonly used to react/respond to the event that has taken place. Stacked Canvas in D2K comes the closest to this component of OA Framework Step 4 Add a button to one of the nested regions • • The itemStyle should be submitButton. hence AM is needed. Primarily two functions [should I call methods] will be created processRequest [for UI Rendering Handling] and processFormRequest Think of processRequest as WHEN-NEW-FORM-INSTANCE. • Region is what will store your fields. it connects to a single session of Oracle and sticks to that single Oracle database session. Step 3 You create Region within the Page.getParameter("Cancel") != null) (Do your processing for Cancellation/ Rollback) Copyright © 2013. in case you want the page to be submitted when this button is clicked There is no WHEN-BUTTON-PRESSED trigger in OAF. So is not the case in OAF. you will add a controller java code to handle events like Form Submit button clicks. All rights reserved . as there is no concept of Connection Pooling and that D2k is not stateless. Text input fields will be of type messageTextInput. findChildRecursive("HelloName"). fieldHelloName.forwardImmediately to re-direct the page navigation to some other page if needed. all the field values get passed into to OAPageContext object. each GUI component is a bean that gets initialised during processRequest. Step 5 In the controller to access the value in field "HelloName" the command is String userContent = pageContext. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 if(oapagecontext. then do not use setText in controller Note 3.getParameter("Update") != null) (Do your validations and commit here) In the above three examples. If the field comes from View Object. you could be calling oapagecontext.setText(pageContext. In OAFramework."Setting the default value" ). AppsLead. we used :block. use OAMessageTextInputBean field HelloName = (OAMessageTextInputBean)webBean. at submission of page. Those who are familiar with D2K forms.getParameter("Submit") != null) (Do your validations and commit here) if(oapagecontext. Do not set the value in processFormRequest Note 2. something like pre-query may be written in this method. processRequest In this method. you can use setText to assign values in processRequest method Lets take some notes to expand beyond the HelloWorld Project Note 1 Copyright © 2013. Effectively.field. In D2k. usually page rendering related code is written.getParameter("HelloName"). • • Use getParameter to access the field value To set the value of the field. For control fields [that are not based on View Objects]. Note when setting field value in controller: Note 1. you can access the values of the page by using notation pageContext. your OA Page is nothing but a XML file. and fields being within Regions. However in OA Framework. Note 2 In D2k.getParameter("<fieldname here>"). This is not a formal/accurate understanding of analogy between D2k and Framework. Usually this is underneath $JAVA_TOP/oracle/apps/. This method processFormRequest is executed when the OAF Screen/Page is submitted by click of a button..Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 In D2K-forms we sort of created a Window. AppsLead. This xml file must then be loaded into database by using XML Importer command. almost everything else is merely deployed to your mid-tier. ignore the steps for setting "Attribute Sets"../. and then fields within that Canvas. It was fmx file that was deployed on mid-tier. your Forms fmb file was compiled to fmx. All rights reserved . Note 7 Inside the controller. You can create a Controller per Page or have a different Controller for each of the Regions with the same Page. all the Database Related interactions for example Copyright © 2013. etc.. Think of these like Visual Attributes of D2K forms Note 5 Controller is where you will write any java code in OA Framework. think of Region being a Canvas. In case of OAF./.. attached to Canvas. Note 4 When building tutorial. Note 6 In the method processFormRequest of the Controller. but is close to being logical. think of Page being fmx/Window. Whatever name you give to "Page" in OAF. Note 3 Apart from MDS XML file. All java files will go underneath java top/oracle/apps/. We call this MDS [meta data]. Oracle might just have developed their tutorials without including these. an XML file of the same name gets created. These are not mandatory. To traverse through those records. Note 9 I wish to access the fields in multi record block that is based on view Object. Similarly. AppsLead. Note 8 In D2K. OAApplicationModuleImpl oaapplicationmoduleimpl = OAApplicationModuleImpl)oapagecontext. All rights reserved .getDBTransaction().getApplicationModule(oaweb bean).Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 interaction with View Objects happen via Application Module.jbo. (String)row. fetch the value of the fields within the loop as oracle. in OA Framework. But why so? Because Application Module Manages the transaction state of the Application.getRowAtRangeIndex(loop index here). Can I do this in Controller? Sure you can.findV iewObject("VO Name Here") Loop through the records in View Objects using count returned from oaviewobject. OADBTransaction oadbtransaction = OADBTransaction)oaapplicationmoduleimpl. A view Object can either be based on a view/table.getFetchedRowCount() For each record. synonym or on a SQL statement. do the below • Get the reference to the View Object using (OAViewObject)oapagecontext. if the field does not have view Object attached.getAttribute("Column name of VO here "). we have control block or a block based on database view.Row row = oaviewobject. • • Copyright © 2013.getApplicationModule(oawebbean). field HelloName is a control field [in D2K terminology]. Hence in HelloWorld example. then it is like a control field. We will try to implement a OAF page to Call Application Developer > Profile Form by clicking Go Button 1.Calld2kformfromOAFAM Package -. Create a New OA Workspace and Empty OA Project File> New > General> Workspace Configured for Oracle Applications File Name -. AppsLead.oracle. Create a OA components Page Calld2kformfromOAF right click > New > OA Components > Page Name -.webui 5.prajkumar.prajkumar.Calld2kformfromOAF. Modify the Page Layout (Top-level) Region Copyright © 2013. Set Run Options in OA Project Setting Select Your Project in the Navigator and choose Project Properties Select Oracle Applications > Run Options Select OADeveloperMode and OADiagnostic. Create Application Module AM Calld2kformfromOAF right click > New > ADF Business Components > Application Module Name -.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Call D2K Form from OAF Page This blog is about to call D2K form from OAF page.prajkumar.apps. All rights reserved .CallformfromOAF Project Name – Calld2kformfromOAF Default Package -.Calld2kformfromOAF. and move them to selected Options List 3.apps.Calld2kformfromOAFPG Package -.Calld2kformfromOAF 2.apps.oracle.fnd.fnd.fnd.server Check Generate JavaFile(s) 4.oracle. Create a container Region for Go-Button Select MainRN right click > New > messageLayout Attribute Region Property ButtonLayout Copyright © 2013.oracle.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Attribute ID Region Style Form Property Auto Footer Window Title Title AM Definition Property PageLayoutRN pageLayout True True Call D2K from OAF Page Window Title Call D2K from OAF Page Header prajkumar. AppsLead. Calld2kformfromOAFAM 6.fnd. Create the Second Region (Main Content Region) Select PageLayoutRN right click > New > Region Attribute ID Region Style Property MainRN messageComponentLayout 7.apps. All rights reserved .ser ver.Calld2kformfromOAF. Create a Second Item (Go Button) Select ButtonLayout > New > Item Attribute ID Item Style Attribute Set Property Go submitButton /oracle/apps/fnd/attributesets/Buttons/Go 9. if (pageContext.fnd.oracle.Calld2kformfromOAF. All rights reserved .processFormRequest(pageContext. Run Your page Copyright © 2013. Add a Controller Select MainRN right click > Set New Controller Package Name -. webBean). Edit Your Controller Add Following Code in processFormRequest public void processFormRequest(OAPageContext pageContext. Congratulation you have successfully finished.apps.webui Class Name -. pageContext.getParameter("Go") != null) { //form:APPLICATION_SHORT_NAME:RESPONSIBILITY_KEY:DATA_GROUP_NAME //:FORM_FUNCTION_NAME String destination = "form:FND:APPLICATION_DEVELOPER:STANDARD:FND_FNDPOMPO". AppsLead.Calld2kformfromOAFCO 10.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 8.forwardImmediatelyToForm(destination).prajkumar. OAWebBean webBean) { super. } } 11. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 and Test Your Work Copyright © 2013. AppsLead. All rights reserved . Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Call OAF Page from D2K form This blog is about to call OAF page from D2K form. We will take one D2K form from there we will try to call our OAF Page with parameters. In OAF page, there it will show that parameter values as message when it will open Let us Create Our OAF Page 1. Create a New OA Workspace and Empty OA Project File> New > General> Workspace Configured for Oracle Applications File Name – CallOAFfromD2KForm Project Name – CallOAFfromD2KProj Default Package -- prajkumar.oracle.apps.fnd.CallOAFfromD2K 2. Create Application Module AM CallOAFfromD2KProj right click > New > ADF Business Components > Application Module Name -- CallOAFfromD2KAM Package -- prajkumar.oracle.apps.fnd.CallOAFfromD2K.server Check Generate JavaFile(s) 3. Create a OA components Page CallOAFfromD2KProj right click > New > OA Components > Page Name -- CallOAFfromD2KPG Package -- prajkumar.oracle.apps.fnd.CallOAFfromD2K.webui 4. Modify the Page Layout (Top-level) Region ID -- PageLayoutRN Region Style – pageLayout Form Property – True Copyright © 2013, AppsLead. All rights reserved Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Auto Footer -- True Window Title – OAF Page Call From D2K Form Window Title Title -- OAF Page Call From D2K Form Header AM Definition -- prajkumar.oracle.apps.fnd.CallOAFfromD2K.server.CallOAFfromD2KAM 5. Consider following D2K form This Form has First Name and Last Name. We will send First Name and Last Name values to our OAF page as parameter 6. Add following Code in WHEN_BUTTON_PRESSED trigger of SUBMIT button Copyright © 2013, AppsLead. All rights reserved Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 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; Note – Here FUNCTION_NAME is OAF page function name Copyright © 2013, AppsLead. All rights reserved Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 7. Add a Controller in OAF Page Select PageLayoutRN right click > Set New Controller Package Name -- prajkumar.oracle.apps.fnd.CallOAFfromD2K.webui Class Name -- CallOAFfromD2KCO 8. Add following Code in Controller import oracle.apps.fnd.framework.OAException; ... public void processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processFormRequest(pageContext, webBean); String firstName = pageContext.getParameter("FIRSTNAME") ; String lastName = pageContext.getParameter("LASTNAME") ; String message = "Hello " + firstName + " " + lastName; Copyright © 2013, AppsLead. All rights reserved Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 throw new OAException(message, OAException.INFORMATION); } 9. Build Your Controller 10. Congratulation you have successfully finished. Run Form and Test Your Work Copyright © 2013, AppsLead. All rights reserved All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. AppsLead. prajkumar.HostandURL Project Name – HostandURLProj Default Package -. All rights reserved .HostandURLAM Package -. Create Application Module AM HostandURLProj right click > New > ADF Business Components > Application Module Name -.oracle.fnd. We will try to implement one button which will give host and URL of OAF page 1.apps.oracle.webui 5. Modify the Page Layout (Top-level) Region Copyright © 2013. and move them to selected Options List 3.fnd.fnd.hostandurl 2.hostandurl.prajkumar.oracle.prajkumar. Create a OA components Page HostandURLProj right click > New > OA Components > Page Name -.hostandurl. Set Run Options in OA Project Setting Select Your Project in the Navigator and choose Project Properties Select Oracle Applications > Run Options Select OADeveloperMode and OADiagnostic.apps. AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Get Host Name and URL of OAF Page This blog is about to get Host name and URL of OAF page.HostandURLPG Package -.server Check Generate JavaFile(s) 4. Create a New OA Workspace and Empty OA Project File> New > General> Workspace Configured for Oracle Applications File Name -.apps. hostandurl. Create a container Region for Go-Button Select MainRN right click > New > messageLayout Attribute Region Property ButtonLayout Copyright © 2013. AppsLead. Create the Second Region (Main Content Region) Select PageLayoutRN right click > New > Region Attribute ID Region Style Property MainRN messageComponentLayout 7.fnd.apps.oracle.server.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Attribute ID Region Style Form Property Auto Footer Window Title Title AM Definition Property PageLayoutRN pageLayout True True Get Host and URL Window Title Get Host and URL Page Header prajkumar. All rights reserved .HostandUR LAM 6. putDialogMessage(new OAException(hostname.oracle. Create a Item (Go Button) Select ButtonLayout > New > Item Attribute ID Item Style Attribute Set Property Go submitButton /oracle/apps/fnd/attributesets/Buttons/Go 9.apps.getHostName().framework.hostandurl.getLocalHost(). oracle. if (pageContext. pageContext. public void processFormRequest(OAPageContext pageContext. OAWebBean webBean) { super. String hostname = "Host Name: " +addr.webui Class Name -.getAddress(). All rights reserved . Add a Controller Select MainRN right click > Set New Controller Package Name -. byte[ ] ipAddr = addr.getParameter("Go") != null) { // To get Host Name try { InetAddress addr = InetAddress.net. java. AppsLead. Edit Your Controller Add Following Code in processFormRequest import import import import java.fnd.*.*.prajkumar.fnd.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 8. Copyright © 2013.framework.processFormRequest(pageContext.io.OAPageContext.HostandURLCO 10.webui. oracle.OAException.apps.apps. webBean).fnd. getCurrentUrl (). pageContext. OAException. All rights reserved . } } 11.putDialogMessage(new OAException(pageURL. Congratulation you have successfully finished.WARNING)).Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 OAException. } catch (UnknownHostException e) { } // To Get Page URL String pageURL = "Current Page URL: " + pageContext. AppsLead. Run Your page and Test Your Work Copyright © 2013.WARNING)). All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. fnd. Select the FileUploadPG and go to the strcuture pane where a default region has been created 5.fileuploaddemo.prajkumar.apps.webui 4.oracle.FileUploadPG Package -.FileUploadDemo Default Package -.server Check Application Module Class: FileUploadAMImpl Generate JavaFile(s) 3. AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 OAF Page to Upload Files into Server from local Machine 1. Select region1 and set the following properties -- Attribute ID Property PageLayoutRN Copyright © 2013.apps.prajkumar.oracle.fileuploaddemo 2.prajkumar. Create a New Page Right click on FileUploadDemo > New > Web Tier > OA Components > Page Name -.apps. All rights reserved .fileuploaddemo.FileUploadAM Package -.fnd. Create a New Application Module (AM) Right Click on FileUploadDemo > New > ADF Business Components > Application Module Name -. Create a New Workspace and Project File > New > General > Workspace Configured for Oracle Applications File Name – PrajkumarFileUploadDemo Automatically a new OA Project will also be created Project Name -.oracle.fnd. All rights reserved .oracle. Create a New Item messageFileUpload Bean under MainRN Right click on MainRN > New > messageFileUpload Set Following Properties for New Item -- Attribute ID Item Style Property MessageFileUpload messageFileUpload 8.FileUploa dAM Uploading File into Server from Local Machine Demo Window Uploading File into Server from Local Machine Demo Window Title Title 6.server.apps. Create a New Item Submit Button Bean under MainRN Right click on MainRN > New > messageLayout Set Following Properties for messageLayout -- Attribute Property Copyright © 2013.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 AM Definition prajkumar.fileuploaddemo.fnd. AppsLead. Create messageComponentLayout Region Under Page Layout Region Right click PageLayoutRN > New > Region Attribute ID Item Style Property MainRN messageComponentLayout 7. apps. java. public void processFormRequest(OAPageContext pageContext.apps. oracle.OAException. if(pageContext.FileOutputStream.InputStream.fnd.data.fileuploaddemo.DataObject.io. java.io.cabo.fnd.getParameter("Submit")!=null) { upLoadFile(pageContext.File. Create Controller for page FileUploadPG Right Click on PageLayoutRN > Set New Controller Package Name: prajkumar. OAWebBean webBean) { super.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 ID ButtonLayout Right Click on ButtonLayout > New > Item Attribute ID Item Style Attribute Set Property Submit submitButton /oracle/apps/fnd/attributesets/Buttons/Go 9.framework.io. java.domain.ui.processFormRequest(pageContext. webBean).BlobDomain.jbo. All rights reserved . oracle.oracle. } } Copyright © 2013.webui Class Name: FileUploadCO Write Following Code in FileUploadCO processFormRequest import import import import import import oracle.webBean). AppsLead. getInputStream(). System. byte abyte0[] = new byte[0x19000]. String fileUrl = null. BlobDomain uploadedByteStream = (BlobDomain)fileUploadData. System. int i. System.println("input---->"+input). File file = new File("D:\\PRajkumar". use following Code public void upLoadFile(OAPageContext pageContext. String contentType = (String) fileUploadData.close().If Page has not deployed at instance.out. } } catch(Exception ex) Copyright © 2013.close(). uFileName).out. input = uploadedByteStream.write(abyte0. "UPLOAD_FILE_NAME").println("File output---->"+file). output.out. i). System.selectValue(null. AppsLead. input.println("User File Name---->"+uFileName). try { DataObject fileUploadData = pageContext.out. testing at Local Machine.OAWebBean webBean) { String filePath = "D:\\PRajkumar".selectValue(null. System. 0. uFileName). "UPLOAD_FILE_MIME_TYPE").out. System. while((i = input. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 CODE #1 -.println("uploadedByteStream---->"+uploadedByteStream).println("Default File Path---->"+filePath).println("output----->"+output).getNamedDataObject("MessageFileUpload").out. FileOutputStream output = null.selectValue(null.read(abyte0)) > 0) output. output = new FileOutputStream(file). //FileUploading is my MessageFileUpload Bean Id if(fileUploadData!=null) { String uFileName = (String)fileUploadData. InputStream input = null. uFileName). File file = new File("/u01/app/apnac03r12/PRajkumar".out. FileOutputStream output = null. "UPLOAD_FILE_NAME"). Copyright © 2013. input = uploadedByteStream.selectValue(null. byte abyte0[] = new byte[0x19000].getNamedDataObject("MessageFileUpload").getInputStream().out.out. All rights reserved . output = new FileOutputStream(file). int i.out.out. System.println("User File Name---->"+uFileName). OAException. 0. AppsLead. String contentType = (String) fileUploadData.write(abyte0.ERROR). i).println("input---->"+input).println("File output---->"+file).println("uploadedByteStream---->"+uploadedByteStream). while((i = input.println("output----->"+output). System. "UPLOAD_FILE_MIME_TYPE"). BlobDomain uploadedByteStream = (BlobDomain)fileUploadData.selectValue(null.getMessage(). Use Following Code public void upLoadFile(OAPageContext pageContext.println("Default File Path---->"+filePath).If Page has been Deployed at Instance. String fileUrl = null. System. } } CODE #2 -. InputStream input = null. System. //FileUploading is my MessageFileUpload Bean Id if(fileUploadData!=null) { String uFileName = (String)fileUploadData. try { DataObject fileUploadData = pageContext.OAWebBean webBean) { String filePath = "/u01/app/apnac03r12/PRajkumar/". uFileName).read(abyte0)) > 0) output.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 { throw new OAException(ex.selectValue(null. System.out. System. input. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 output. } } catch(Exception ex) { throw new OAException(ex. OAException. Run Your page and Test Your Work Page has deployed and Used CODE #2 Copyright © 2013. } } 10.getMessage().ERROR). AppsLead. Congratulation you have successfully finished.close().close(). AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Before Upload the File After Upload the File Page has not been deployed and Used CODE #1 Before Upload the File Copyright © 2013. All rights reserved . All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 After Upload the File Copyright © 2013. AppsLead. Edit “orion-application. All rights reserved .e.xml” file to add JAR file path i.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 How to deploy JAR file into R12 server in OA Steps to add JAR file into R12 server in OA -- 1. AppsLead. Open “orion-application.jar" /> Copyright © 2013.xml” file present at path – $ORA_CONFIG_HOME/10.e. Deploy your JAR file at some custom location in R12 server i.1.3/j2ee/oacore/application-deployments/oacore/ 3. – <library path="/u01/app/apnac03r12/XX_TEST/jxl. – /u01/app/apnac03r12/XX_TEST/ 2. AppsLead. Bounce Apache Server Copyright © 2013.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 4. All rights reserved . 6.html Steps to add jxl.com/jar/net.jar.3.3.jar from following link – http://www.3. AppsLead.apps.ImportxlsDemo Default Package -.oracle.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Import Data from Excel sheet to DB Table through OAF page 1.fnd.importxlsdemo 2.jar file in Local Machine Right Click on ImportxlsDemo > Project Properties > Libraries > Add jar/Directory and browse to directory where jxl-2.jar to Apache Library Download jxl-2.findjar.6.6.jar has been downloaded and select the JAR file Copyright © 2013.sourceforge.prajkumar.6. All rights reserved .jexcelapi/jars/jxl-2. Add JAR file jxl-2. Create a New Workspace and Project File > New > General > Workspace Configured for Oracle Applications File Name – PrajkumarImportxlsDemo Automatically a new OA Project will also be created Project Name -. All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. AppsLead. importxlsdemo.apps. Create a New Application Module (AM) Right Click on ImportxlsDemo > New > ADF Business Components > Application Module Name -. AppsLead.oracle. All rights reserved .fnd.prajkumar. Create Test Table in which we will insert data from excel Copyright © 2013.server Check Application Module Class: ImportxlsAMImpl Generate JavaFile(s) 4.ImportxlsAM Package -.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Click here to know Steps to Add JAR file into R12 server in OA 3. column3 VARCHAR2(100).fnd. created_by NUMBER NOT NULL.server Copyright © 2013. Create Method. creation_date DATE NOT NULL.importxlsdemo.server Database Objects -. AppsLead.ImportxlsVO Package -.Data Columns -.--------------------. 5.oracle.-------------------last_update_date DATE NOT NULL. column4 VARCHAR2(100). All rights reserved . last_updated_by NUMBER NOT NULL.apps.--------------------.prajkumar.schema.-------------------column1 VARCHAR2(100).XX_IMPORT_EXCEL_DATA_DEMO Note – By default ROWID will be the primary key if we will not make any column to be primary key Check the Accessors. Validation Method and Remove Method 6. column5 VARCHAR2(100).importxlsdemo.Who Columns -. column2 VARCHAR2(100).Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 CREATE TABLE xx_import_excel_data_demo ( -. Create a New Entity Object (EO) Right click on ImportxlsDemo > New > ADF Business Components > Entity Object Name – ImportxlsEO Package -. last_update_login NUMBER ).apps.prajkumar. -.oracle.fnd. Create a New View Object (VO) Right click on ImportxlsDemo > New > ADF Business Components > View Object Name -. apps.webui 9.prajkumar.oracle.fnd.importxlsdemo.fnd. Select the ImportxlsPG and go to the strcuture pane where a default region has been created 10. Add Your View Object to Root UI Application Module Right click on ImportxlsAM > Edit ImportxlsAM > Data Model > Select ImportxlsVO and shuttle to Data Model list 8.Importxls AM Import Data From Excel through OAF Page Demo Window Import Data From Excel through OAF Page Demo Window Title Title Copyright © 2013.oracle.server. All rights reserved . AppsLead.apps. Select region1 and set the following properties: Attribute ID AM Definition Property PageLayoutRN prajkumar.importxlsdemo. Create a New Page Right click on ImportxlsDemo > New > Web Tier > OA Components > Page Name -.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 In Step2 in Entity Page select ImportxlsEO and shuttle it to selected list In Step3 in Attributes Window select all columns and shuttle them to selected list 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 7.ImportxlsPG Package -. Create a New Item Submit Button Bean under MainRN Right click on MainRN > New > messageLayout Set Following Properties for messageLayout -- Attribute ID Property ButtonLayout Right Click on ButtonLayout > New > Item Copyright © 2013. AppsLead. Create a New Item messageFileUpload Bean under MainRN Right click on MainRN > New > messageFileUpload Set Following Properties for New Item -- Attribute ID Item Style Property MessageFileUpload messageFileUpload 13. Create messageComponentLayout Region Under Page Layout Region Right click PageLayoutRN > New > Region Attribute ID Item Style Property MainRN messageComponentLayout 12. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 11. OAPageContext.jbo.Serializable.framework.OAControllerImpl.webui.selectValue(null.getNamedDataObject("MessageFileUpload").webui Class Name: ImportxlsCO Write Following Code in ImportxlsCO in processFormRequest import import import import import import import import oracle.importxlsdemo.apps. oracle. String fileName = null.framework.apps.OAWebBean.fnd.domain. oracle.getParameter("Go") != null) { DataObject fileUploadData = (DataObject)pageContext.oracle.framework.fnd.apps. public void processFormRequest(OAPageContext pageContext.apps. All rights reserved .io.fnd.processFormRequest(pageContext. Create Controller for page ImportxlsPG Right Click on PageLayoutRN > Set New Controller Package Name: prajkumar.cabo.fnd.beans.data. OAWebBean webBean) { super.ui. oracle.webui.fnd.apps. if (pageContext. java.OAApplicationModule.DataObject. "UPLOAD_FILE_NAME"). AppsLead.apps.OAException.webui.framework. webBean).framework. oracle. oracle.fnd.BlobDomain.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Attribute ID Item Style Attribute Set Property Go submitButton /oracle/apps/fnd/attributesets/Buttons/Go 14. oracle. } catch(NullPointerException ex) { Copyright © 2013. try { fileName = (String)fileUploadData. aserializable2. fileName).framework. oracle. } } } Write Following Code in ImportxlsAMImpl.jbo.BlobDomain. } catch (Exception ex) { throw new OAException(ex.apps. oracle. OAException.fnd. jxl.OAViewObjectImpl.CellType.apps.InputStream.server.fnd.server. jxl.ERROR). try { OAApplicationModule oaapplicationmodule = pageContext.jbo. if (!vo.OAApplicationModuleImpl.IOException.invokeMethod("ReadExcel". jxl. All rights reserved .OAViewObject.biff.read. } BlobDomain uploadedByteStream = (BlobDomain)fileUploadData.class }.getRootApplicationModule().domain.apps.Workbook.io.java import import import import import import import import import import import import java. oracle. oaapplicationmodule.io. oracle. jxl.Row.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 throw new OAException("Please Select a File to Upload". jxl.framework. oracle.aclass2).framework.fnd. Serializable aserializable2[] = {uploadedByteStream}. } Copyright © 2013.toString().ERROR). java.executeQuery().BiffException. OAException.Cell. public void createRecord(String[] excel_data) { OAViewObject vo = (OAViewObject)getImportxlsVO1(). Class aclass2[] = {BlobDomain.selectValue(null. AppsLead.isPreparedForExecution()) { vo.Sheet. getColumns(). i < excel_data.getRows().Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Row row = vo.getType() == CellType. for (int i = 0.getContents(). try { w = Workbook. All rights reserved . excel_data[j] = cell.getWorkbook(inputWorkbook). InputStream inputWorkbook = fileData.println("I got a label " + cell.getMessage()). CellType type = cell. j++) { Cell cell = sheet.insertRow(row). Workbook w.LABEL) { System. i). // Get the first sheet Sheet sheet = w. Copyright © 2013. i++) { row.length.getType(). } } catch(Exception e) { System.excel_data[i]).createRow(). i < sheet.println(e.getContents()).getType() == CellType. } else if (cell.setAttribute("Column" +(i+1) .commit(). if (cell.NUMBER) { System.getContents()). getTransaction(). } public void ReadExcel(BlobDomain fileData) throws IOException { String[] excel_data = new String[5].out. try { for (int i=0.getCell(j. j < sheet.out.println("I got a number " + cell.getSheet(0). i++) { for (int j = 0.getInputStream(). } vo.out. AppsLead. AppsLead.xls with following data -- Lets Try to import this data into DB Table -- Copyright © 2013. } else { excel_data[j] = "". Congratulation you have successfully finished.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 excel_data[j] = cell.printStackTrace().getContents(). All rights reserved . } } catch (BiffException e) { e. Run Your page and Test Your Work Consider Excel PRAJ_TEST. } } 15. } } createRecord(excel_data). All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. AppsLead. com/mvn/central/org. Add following JAR files to Apache Library 1.fnd. poi-3.prajkumar.jar http://grepcode.jar http://www. ooxml-schemas-1.jarfinder.1. Create a New Workspace and Project File > New > General > Workspace Configured for Oracle Applications File Name – PrajkumarImportxlsDemo Automatically a new OA Project will also be created Project Name -.maven. AppsLead.0.xlsx file to DB Table through OAF page 1.org/maven2/org.com/index.1.apps.php/jars/versionInfo/69009 4.com/artifact/log4j/log4j/1.poi/ooxml-schemas/1.7.16 5.importxlsdemo 2.jar http://mvnrepository. poi-ooxml-3.poi/poi/3.7 2.apache.com/snapshot/repo1. stax-api-1.7.ImportxlsDemo Default Package -.com/artifact/org.com/artifact/org.jar http://mvnrepository.apache. poi-ooxml-schemas-3.apache.7 6.1 3.apache.7-beta1 Copyright © 2013.2.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Import Data from *.poi/poi-ooxml-schemas/3.oracle.2.16.7-20101029. All rights reserved . log4j-1.poi/poiooxml/3.jar http://mavenhub.jar http://mvnrepository. 6. xmlbeans-2.com/snapshot/repo1.1.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 7.jar http://grepcode.php/jars/versionInfo/14387 8. AppsLead.maven.org/maven2/dom4j/dom4j/1.jar http://www.1 Steps to add JAR files in Local Machine Right Click on ImportxlsDemo > Project Properties > Libraries > Add jar/Directory and browse to directory where all JAR files have been downloaded and select the JAR files Copyright © 2013.4. All rights reserved .0.jarfinder. dom4j-1.com/index.6. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . AppsLead. ImportxlsAM Package -.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Click here to know Steps to Add JAR file into R12 server in OA 3.prajkumar. All rights reserved .importxlsdemo. Create a New Application Module (AM) Right Click on ImportxlsDemo > New > ADF Business Components > Application Module Name -. Create Test Table in which we will insert data from *.fnd.xlsx file CREATE TABLE xx_import_excel_data_demo Copyright © 2013.oracle.server Check Application Module Class: ImportxlsAMImpl Generate JavaFile(s) 4. AppsLead.apps. XX_IMPORT_EXCEL_DATA_DEMO Note – By default ROWID will be the primary key if we will not make any column to be primary key Check the Accessors. All rights reserved .schema.Data Columns -.oracle.-------------------last_update_date last_updated_by creation_date created_by last_update_login VARCHAR2(100).Who Columns -.--------------------.ImportxlsVO Package -. Validation Method and Remove Method 6. AppsLead. NUMBER NOT NULL.server Database Objects -. NUMBER ). 5.apps. Create Method. NUMBER NOT NULL. VARCHAR2(100). VARCHAR2(100).fnd. Create a New View Object (VO) Right click on ImportxlsDemo > New > ADF Business Components > View Object Name -. Create a New Entity Object (EO) Right click on ImportxlsDemo > New > ADF Business Components > Entity Object Name – ImportxlsEO Package -. VARCHAR2(100).prajkumar.prajkumar.importxlsdemo.-------------------column1 column2 column3 column4 column5 -.apps.--------------------.oracle. DATE NOT NULL. DATE NOT NULL.server In Step2 in Entity Page select ImportxlsEO and shuttle it to selected list Copyright © 2013.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 ( -. VARCHAR2(100).importxlsdemo.fnd. ImportxlsPG Package -. Select the ImportxlsPG and go to the strcuture pane where a default region has been created 10.importxlsdemo. AppsLead.xlsx) through OAF Page Demo Window Import Data From Excel(*.webui 9.oracle.oracle.fnd.xlsx) through OAF Page Demo Window Title Title Copyright © 2013.fnd.apps.importxlsdemo.apps.prajkumar.server.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 In Step3 in Attributes Window select all columns and shuttle them to selected list 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 7. Add Your View Object to Root UI Application Module Right click on ImportxlsAM > Edit ImportxlsAM > Data Model > Select ImportxlsVO and shuttle to Data Model list 8. Select region1 and set the following properties: Attribute ID AM Definition Property PageLayoutRN prajkumar.Importxls AM Import Data From Excel(*. Create a New Page Right click on ImportxlsDemo > New > Web Tier > OA Components > Page Name -. All rights reserved . Create messageComponentLayout Region Under Page Layout Region Right click PageLayoutRN > New > Region Attribute ID Item Style Property MainRN messageComponentLayout 12. AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 11. All rights reserved . Create a New Item messageFileUpload Bean under MainRN Right click on MainRN > New > messageFileUpload Set Following Properties for New Item -- Attribute ID Item Style Property MessageFileUpload messageFileUpload 13. Create a New Item Submit Button Bean under MainRN Right click on MainRN > New > messageLayout Set Following Properties for messageLayout -- Attribute ID Property ButtonLayout Right Click on ButtonLayout > New > Item Copyright © 2013. OAWebBean. oracle. oracle.framework.selectValue(null. public void processFormRequest(OAPageContext pageContext.fnd.fnd. } catch(NullPointerException ex) { Copyright © 2013.fnd.io.BlobDomain.processFormRequest(pageContext.data.apps.Serializable.domain.webui.apps.webui. oracle.getNamedDataObject("MessageFileUpload").webui.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Attribute ID Item Style Attribute Set Property Go submitButton /oracle/apps/fnd/attributesets/Buttons/Go 14. oracle.fnd. AppsLead.ui.OAException. "UPLOAD_FILE_NAME"). oracle. All rights reserved .fnd.getApplicationModule(webBean). Create Controller for page ImportxlsPG Right Click on PageLayoutRN > Set New Controller Package Name: prajkumar. webBean). oracle. OAApplicationModule am = pageContext.apps.getParameter("Go") != null) { DataObject fileUploadData = (DataObject)pageContext.OAPageContext.DataObject.jbo. OAWebBean webBean) { super. if (pageContext.OAApplicationModule.framework.framework.beans. try { fileName = (String)fileUploadData.OAControllerImpl. String fileName.framework.oracle.framework.cabo.fnd.apps.webui Class Name: ImportxlsCO Write Following Code in ImportxlsCO in processFormRequest import import import import import import import import oracle. java.apps.importxlsdemo.apps. OAViewObjectImpl.Cell. org.DateFormat. Serializable aserializable2[] = {uploadedByteStream}.IOException. java.text.ss. All rights reserved .InsertRecord(excel_data).apache. Class aclass2[] = {BlobDomain.poi. OAException.invokeMethod("ReadExcel". java.usermodel. aserializable2.xssf.SimpleDateFormat. vo.xssf.ss. } Select a File to Upload". AppsLead. oaapplicationmodule.apps.poi.getRootApplicationModule(). public void createRecord(String[] excel_data) { ImportxlsVOImpl vo = (ImportxlsVOImpl)getImportxlsVO1().toString().apache. } public void ReadExcel(BlobDomain fileData) throws IOException { try Copyright © 2013. getTransaction().*.apps.io.server.fnd. oracle.ss.ERROR).apache.OAApplicationModuleImpl. java. org.DateUtil.Row.XSSFSheet. } } } Write Following Code in ImportxlsAMImpl. = try { OAApplicationModule oaapplicationmodule = pageContext.BlobDomain.aclass2).commit(). org.framework. org. org.class }.poi.domain.apache.usermodel.server.poi.selectValue(null.java import import import import import import import import import import import import oracle.ERROR).usermodel.poi.usermodel. java.apache.usermodel. BlobDomain uploadedByteStream (BlobDomain)fileUploadData.io. } catch (Exception ex) { throw new OAException(ex.jbo.text.framework. fileName).XSSFWorkbook.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 throw new OAException("Please OAException.fnd. oracle. resultVar = (int)cell. excel_data[j] = Integer.format(cell. All rights reserved . AppsLead.toString(resultVar). } String[] excel_data = new String[colCounts+1].CELL_TYPE_STRING: excel_data[j] = cell.getString(). } else { int resultVar.getLastCellNum(). try { colCounts = row.getRow(i). break.getCell(k). for (int i = 0.getSheetAt(0). XSSFWorkbook workbook = new XSSFWorkbook(in). k++) { j=j+1. Copyright © 2013.getLastRowNum(). } catch (NullPointerException e) { colCounts=1. XSSFSheet sheet = workbook. int colCounts.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 { InputStream in = fileData. excel_data[j] =df.getCellType()) { case Cell.getRichStringCellValue(). int rowsCount = sheet.CELL_TYPE_NUMERIC: if (DateUtil.getNumericCellValue().isCellDateFormatted(cell)) { DateFormat df = new SimpleDateFormat("MM/dd/yyyy").getDateCellValue()). Row row = sheet. switch (cell. } break. case Cell. for (int k = 0. k < colCounts. i++) { int j = 0. try { Cell cell = row.getBinaryStream(). i <= rowsCount. server. for (int i=1.jbo. Row row = createRow(). } } catch (IOException e) { e. } } Write Following Code in ImportxlsVOImpl.excel_data[i]). AppsLead.length. case Cell.CELL_TYPE_FORMULA: excel_data[j] = (String)cell. All rights reserved .setAttribute("Column" +i .getBooleanCellValue()). } } catch (NullPointerException e) { excel_data[j] = "".fnd. default: excel_data[j] = "".getCellFormula().CELL_TYPE_BOOLEAN: excel_data[j] = Boolean.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 case Cell.printStackTrace(). i < excel_data.OAViewObjectImpl. break.Row. } } createRecord(excel_data). break.toString(cell.java import oracle. insertRow(row). import oracle.apps. public void InsertRecord(String[] excel_data) { try { executeQuery(). } } catch(Exception e) { Copyright © 2013. i++) { row.framework. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 System. AppsLead.getMessage()). All rights reserved .xlsx with following data -- Lets Try to import this data into DB Table -- Copyright © 2013. } } 15. Run Your page and Test Your Work Consider Excel PRAJ_TEST.out.println(e. Congratulation you have successfully finished. AppsLead. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Category: Oracle Tags: importing_data_from_xlsx_sheet Copyright © 2013. java 3.tools.xml. Copy all files from local machine to appropriate $JAVA_TOP directory 2. Call java importer to import all xml files java oracle.1000) Example – DECLARE BEGIN jdr_utils.importer.jrad.1000). 5.printDocument('/prajkumar/oracle/apps/fnd/webui/HelloWorldPG'. AppsLead. END. Compile all java files (Controller Files) with command javac <file_name>.jsp? page=/prajkumar/oracle/apps/fnd/webui/HelloWorldPG" Copyright © 2013. All rights reserved .printDocument('/prajkumar/oracle/apps/fnd/webui/HelloWorldPG'. Create form function with property "SSWA jsp function" and webhtml "OA.PUT_LINE(SQLERRM).XMLImporter $JAVA_TOP/prajkumar/oracle/apps/fnd/webui/HelloWorldPG.xml -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp) (HOST= <name of HOST>)(PORT=<port_number>)) (CONNECT_DATA=(SID=<SID_NAME>)))" -rootdir $JAVA_TOP 4. EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Deploy OAF page 1. Print Documents to check imported XML page content (Optional) jdr_utils. All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 6. AppsLead. Add function to menu Copyright © 2013. All rights reserved . Add menu to responsibility Copyright © 2013. All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 7. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. AppsLead. AppsLead.sh start Copyright © 2013.sh stop Start Server sh $INST_TOP/admin/scripts/adoacorectl.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Bounce Apache Server Release 12 (Run following command in UNIX) Stop Server sh $INST_TOP/admin/scripts/adoacorectl. All rights reserved .sh start Release 11 (Run following command in UNIX) Stop Server sh $COMMON_TOP/admin/scripts/KTPLDEV_trishul/adapcctl.sh stop Start Server sh $COMMON_TOP/admin/scripts/KTPLDEV_trishul/adapcctl. All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 How to Enable Personalization link for OAF Pages Set the values of following profiles to enable Personalization Page link in OAF Pages Profile Name FND: Personalization Region Link Enabled Personalize Self-Service Defn Disable Self-Service Personal Value Yes Yes No After Setting the Values of above profiles Copyright © 2013. Now when we click on Go button all the records are displaying in the results table and our OBJECTIVE is to bind the VO query of results table in such a way that in result Column1 valueval5 and Column2 value val6 should not come as result on click Go button Copyright © 2013.apps.webui.fnd.oracle. Right Click PageLayoutRN under SearchPG page > Set New Controller Package Name -.oracle. All rights reserved . Let us try to Extend Controller in OAF Page – Create one search page as explained in below link – https://blogs. Controller extensions are therefore not considered to be durable between upgrades.OAControllerImpl) methods should effectively be considered private. First lets create CO for SearchPG. The purpose of this exercise is to modify the VO query of results table.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Controller Extension in OAF Oracle does not recommend that customers extend controller objects associated with regions or webbeans in shipped E-Business Suite product pages.com/prajkumar/entry/create_oaf_search_page In this exercise I am going to extend CO of SearchPG.prajkumar.fnd. since their implementation is subject to change.framework. processFormRequest() is the only method that should be overriden in a controller class. I have changed theColumn1 and Column2 fields Property Selective Search Criteria as False. Controller class (oracle.SearchCO Now we will extend this newly created CO under this exercise. AppsLead. although the risks outlined above still apply. If it is absolutely essential to handle custom form submit events on a shipped product page.searchdemo.webui Class Name -.apps. All rights reserved . Here we can see the Name of the controller that we need to extend Copyright © 2013. AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Now for knowing which controller to extend we click on "About This Page" Link and select Expand All. AppsLead. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 1. Create a New Workspace and Project File > New > General > Workspace Configured for Oracle Applications File Name – PrajkumarCOExtensionDemo Copyright © 2013. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Automatically a new OA Project will also be created Project Name -.coextensiondemo.apps.oracle.oracle.prajkumar.prajkumar.searchdemo. Create a New Java Class Right Click on COExtensionDemo > New > General > Java Class Name -.apps.server Extends -.COExtensionDemo Default Package -.fnd.prajkumar.fnd.coextensiondemo 2.webui.apps.fnd.oracle. All rights reserved .SearchCO Copyright © 2013. AppsLead.ExtendedCO Package -. OAQueryBean.apps.OAApplicationModule. oracle.framework.oracle.fnd.apps.beans.fnd.webui.beans.OAPageContext.apps.fnd.server. import prajkumar.OAWebBean. oracle. Write below logic in ExtendedCO Java Class package prajkumar.webui.apps. AppsLead.framework. import import import import import oracle.oracle.fnd.searchdemo.SearchCO.fnd. All rights reserved .webui.Give the Name of your Extended Class give its package path and in the extends property select base class 3.fnd.oracle.processFormRequest(pageContext.layout. webBean). prajkumar.coextensiondemo.webui.webui.SearchVOImpl.apps. oracle.apps.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Note -.framework. OAWebBean webBean) { super.fnd.framework.apps. Copyright © 2013.searchdemo. public class XXItemSearchCO extends ItemSearchCO { public XXItemSearchCO() { } public void processFormRequest(OAPageContext pageContext. setWhereClauseParam(0.setWhereClauseParam(1. vo. vo.getParameter(go)!=null) { // Setting whereClause at Runtime to restrict the query SearchVOImpl vo = (SearchVOImpl)am.getApplicationModule(webBean). //Capturing Go Button ID String go = queryBean.setWhereClause(null).getGoButtonName(). Attach new controller to SearchPG through personalization Click on Personalize Page link on top right hand side of your page Copyright © 2013."val5"). vo. } } } 4. AppsLead. vo.findChildRecursive("QueryRN").findViewObject("SearchVO1").setWhereClause("Column1 <>:1 AND Column2 <>:2"). All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 OAApplicationModule am = pageContext. OAQueryBean queryBean = (OAQueryBean)webBean. //If its Not NULL which mean user has pressed "Go" Button if(pageContext."val6"). All rights reserved .webui.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Note -. AppsLead.fnd.coextensiondemo.oracle.apps.If you are not able to see this link then go through below link – https://blogs.ExtendedCO Copyright © 2013.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. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Click Apply -> Return to Application 5. All rights reserved . AppsLead. Congratulation you have successfully finished. Run Your SearchPG page and Test Your Work Copyright © 2013. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Click Go Note – Record with Column1 value val5 and Column2 value val6 is not coming in result Copyright © 2013. All rights reserved . AppsLead. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. AppsLead. oracle.-------------------user_id VARCHAR(50). AM extension is also not supported by Oracle.-------------------.------------------last_update_date DATE NOT NULL.fnd.server.-------------------. creation_date DATE NOT NULL. However for some business needs we have to extend it sometimes. last_updated_by NUMBER NOT NULL. -. AppsLead. } Our business need is to capture user name and user id at runtime and insert it into a custom audit table for audit purpose Here is Audit Table script -CREATE TABLE xx_audit ( -. user_name VARCHAR(50).apps.commit(). created_by NUMBER NOT NULL. Copyright © 2013. public void apply() { getTransaction().insertdemo.e.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Application Module Extension in OAF Like the Controller extension. All rights reserved . InsertAM This AM can be found under below BC4J packageprajkumar. In this exercise we have taken our “Data Entry OAF page” can be found @https://blogs. last_update_login NUMBER ).InsertAM Why we are extending AM:This InsertAM contains an apply method which subsequently commits the transaction.oracle.Who Columns -.com/prajkumar/entry/insert_data_oaf_page to extend application module i.Data Columns -. All rights reserved .fnd.server.InsertAM Copyright © 2013.fnd.insertdemo.apps. Create a New Application Module (AM) Right Click on InsertDemo > New > ADF Business Components > Application Module Package -.oracle.server Name -. AppsLead.ExtendedAM Extends -.prajkumar.insertdemo.oracle.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Steps to Extend Application Module (AM) 1.apps.prajkumar. AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. AppsLead. framework. getOADBTransaction().java import oracle.. try { Connection conn = getOADBTransaction().sql.OAException.getCurrentDBDate().:6.dateValue().:5.:3.:2. getOADBTransaction().Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Write following code in ExtendedAMImpl.setString(2.:7)".PreparedStatement. Copyright © 2013.fnd. AppsLead. import java.getUserName()).prepareStatement(Query).Connection.. All rights reserved .getUserId()).getJdbcConnection().sql. import java. String Query = "insert into xx_audit values(:1. stmt. public class ExtendedAMImpl extends InsertAMImpl { . public void apply() { java.apps. PreparedStatement stmt = conn.sql.setInt(1.Date d = getOADBTransaction()..:4. stmt. setInt(6. d).Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 stmt. stmt.getUserId()). stmt. getOADBTransaction().jpx Business Components > Substitutions Copyright © 2013.getUserId()). d).apply(). getOADBTransaction(). getOADBTransaction(). AppsLead. stmt. All rights reserved . } catch(Exception exception) { throw new OAException("Error in Staffing Query"+exception.getUserId()). } super. stmt. } } 2. OAException.setInt(4.setDate(3. stmt. Perform AM Substitution Double Click on InsertDemo.setDate(5.execute().setInt(7.ERROR). Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . AppsLead. All rights reserved . AppsLead.e. Migrate/ Import the modified jpx Open Command Prompt and go to following location of your projectD:\xxxx\jdevbin\oaext\bin Use this Import Command to import jpx Copyright © 2013.D:\xxxx\jdevhome\jdev\myclasses 4.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 3.jpx In our case it will modify InsertDemo. -.jpx at project location i. After substitution it will modify *. Run Your InsertPG page and Test Your Work Copyright © 2013. Congratulation you have successfully finished. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 5. AppsLead. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. AppsLead. All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 EO based VO Extension in OAF In the exercise we have taken “OAF Search Page“can be found @ https://blogs. Analyze the Page Click on “About this Page” link to check that which ViewObject is associated with the table region [ResultsRN] Copyright © 2013.com/prajkumar/entry/create_oaf_search_page We are going to extend SearchVO of SearchPG page. AppsLead. All rights reserved . Our business requirement is to addCreation Date attribute in the results table region 1.oracle. Now click on Business Component Reference details and check the path of SearchVO Copyright © 2013. All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Here we can see that results table has SearchVO attached to it. So for adding this attribute we need to perform VO Extension. All rights reserved . FTP this project from application server and open in JDeveloper 2. AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 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. Create a New View Object (VO) Right click on SearchDemo > New > ADF Business Components > View Object Copyright © 2013. fnd.server Name – ExtSearchVO Extends -. AppsLead.SearchVO The next screen allows the addition or deletion of Entity Objects.prajkumar.searchdemo.prajkumar. All rights reserved .fnd.apps. No change is required here for this extension so simply select Next Copyright © 2013.searchdemo.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Package -.apps.oracle.server.oracle. Please note the new attribute you would be adding will be coming as Transient Click on Next -> Next Copyright © 2013. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 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 -. AppsLead. SearchEO. All rights reserved .ROWID.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Modify above SQL statement with below SQL to add new attribute CREATION_DATE SELECT SearchEO. SearchEO. AppsLead.CREATION_DATE FROM XX_SEARCH_DEMO SearchEO Click on Next -> Next Generate ExtSearchVORowImpl Copyright © 2013.COLUMN1. SearchEO.COLUMN2. Double click on that attribute i. We need to correct our XML file generated as it is a known error with Jdeveloper 2. All rights reserved .Now as our attribute created as Transient hence to fix this issue we have two options: 1.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Click Finish Note -. AppsLead.xml file in some notepad editor. Scroll to bottom of that file Update Copyright © 2013.e. CreationDate Lets try first method -Open your ExtSearchVO.e CreationDate and in the View Object Attribute window. enter attribute name in 'Expression' column i. Substitute your New VO with parent VO Right click on SearchDemo > Project Properties > Business Components > Substitutions In Available list select SearchVO and in Substitute list select New VO ExtSearchVO and click on Add and then Ok Copyright © 2013.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 with 3. All rights reserved . AppsLead. AppsLead.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 5. All rights reserved . After substitution import *.jpx In our case it will modify SearchDemo.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 4. Personalize the page to create new item On SearchPG click on Personalize Page link Copyright © 2013. All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Select Complete View Radio Button Click on Create Item on Table: (ResultTable) Copyright © 2013. AppsLead.Date Prompt – Creation Date View Instance – ExtSearchVO1 View Attribute – CreationDate Copyright © 2013. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Set item style as messageStyledText Set Following Properties Id – CreationDateId Data Type -. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Click Apply > Return to Application Copyright © 2013. AppsLead. All rights reserved . All rights reserved . Congratulation you have successfully finished.You can notice page has new Column with name Creation Date Copyright © 2013. AppsLead. Run Your SearchPG page and Test Your Work Note -.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 6. AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. All rights reserved . Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Entity Object Extension in OAF In the exercise we have taken “Create Data Entry OAF Page“can be found @ https://blogs.server Extends -.InsertEO Copyright © 2013.insertdemo.fnd.apps.oracle.fnd. All rights reserved . Our business requirement is to add Validation on Column1. 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 -.schema.insertdemo.prajkumar. AppsLead.oracle.schema. 1.server.apps.com/prajkumar/entry/insert_data_oaf_page We are going to extend InsertEO.prajkumar.oracle. The length of entered data in Column1 should be more than 5 Characters. AppsLead. All rights reserved .> New from Table Copyright © 2013.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Click on Next . All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Include all the attributes of parent EO Copyright © 2013. AppsLead. AppsLead. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Next -> Next Check Validation Method check box and Finish Copyright © 2013. Add following code in ExtInsertEOImpl. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 3.validateEntity(). Substitute your New EO with parent EO Copyright © 2013. OAException. if (column1Value.OAException. throw new OAException(message.framework. AppsLead.fnd. protected void validateEntity() { super. } } 4.apps. String column1Value = getColumn1().length() < 5) { String message = "Length of String" + " " + column1Value + "is less than 5 characters".INFORMATION).java import oracle. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 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. -. All rights reserved . AppsLead.e.D:\xxxx\jdevhome\jdev\myclasses Open Command Prompt and go to following location of your project D:\xxxx\jdevbin\oaext\bin Copyright © 2013.jpx In our case it will modify InsertDemo.jpx at project location i. After substitution import *. AppsLead. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Use this Import Command to import jpx 6. Verify the substitution has applied properly Run InsertPG page and click on About this Page link Copyright © 2013. Bounce the server 7. All rights reserved . AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Expand Business Component References Details Under that section click on InsertVO which is EO based [it should be ExtInsertEO based] Copyright © 2013. AppsLead. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 8. All rights reserved . AppsLead. Congratulation you have successfully finished. Run Your InsertPG page and Test Your Work Copyright © 2013. All rights reserved .Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Copyright © 2013. AppsLead. set the where clause and where clause params to null before setting your new where clause.  Fetch Profile Value : Fetching the values like profile .VALUE(‘XXWHO_ENTITY’) FROM DUAL The first option brings the data from the cache. retaining the AM may not remove the cache of VOs and so the result may not be as expected. In such cases. So its better to invalidate cache regularly and use the first option to fetch such kind of values. The AM should not be retained for two independent pages. Fetching it from pageContext. AppsLead. And when required. Syntax: SELECT FND_PROFILE. orgId. But the second option is costly performance wise.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 OA Framework Best Practices  AM Retention : Retaining the AM where not required. So it’s a best practice to make it null wherever it is not required. Syntax : pageContext. 2.  Whenever you are executing a VO or creating rows in a VO in the Copyright © 2013. Remember that the where clause once set will be retained through out. testFunction etc can be done in two ways. Example : Any navigation link that opens in a new page or any navigation which has a back button to come back to the initial page. especially if they have common VOs which fetch different result sets. Not retaining it wherever required – both are dangerous!! The AM should be retained whenever you are navigating away from a page and when you know that there is a possibility to come back to the page again and data is to be retained. so it takes time for the changed values to be reflected in front-end. Write a VO to query the values directly from the data base.  Setting dynamic whereClause : Avoid setting where clauses dynamically as far as possible. Creating two VOs is always better than using a single VO with two dynamic where clauses. 1. All rights reserved .getProfile(‘XXWHO_ENTITY’). Ex : You want to use a lookup name n number of times in your coding.  If you want any values of your CO to be available in your EO. Instead of hardcoding it everywhere. put those values in transaction.  Make it a point to remove all the session parameters and transaction parameters soon after their utilization. Should be very careful with session parameters because they result in unnecessary data and it’s often difficult to debug. you can change it at a single place (in the constants interface) and save time. If you have to change the lookup.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 process request. AppsLead. } This avoids duplicate data or data loss whenever your page is rendered from a dialog page or back button etc. declare it in your constants interface and use the constant in your code. Ex: if(fromPage == “CorrectPage”) { vo.  Whenever you have to get or set values of a VO use Copyright © 2013. No business logic should be written in the CO or AM. Should not create unnecessary transactions anywhere. Try creating private methods in controller wherever you have redundant code.  Passing too many parameters through hashmap not only effects the performance but it also effects the UI  Avoid writing huge code in CO. do it conditionally.  Create separate interface per module for declaring all your constant variables rather than hardcoding the values in the code. Do this only if it is very much required. Let it not get executed every time the process request is called. All rights reserved .executeQuery(). Tomorrow. Only get the already existing transaction object from AM using getTransaction() Method. Should be very careful while creating the viewlink. Because the getAttribute(index) traverses through the entire attributeset in order to find the required attribute which is a performance issue Ex: Say. Especially when getting the values of a radio button selection etc. then need not use VOImpl for calling the executeQuery() method. // break the loop after reaching the last record of the current rowset. Put your Copyright © 2013. Remember to clear the cache of the hgrid each time the hgrid is rendered or the hgrid query is executed.  HGrid cache: Hgrid is one of the components in OAF which gives major surprises to the developer everytime. This increases reusability and modularity. you have an attribute called SelectFlag with attribute index as n .  Always reset a VO before iterating it. Ex : vo.clearCache(). }  Set any VO’s where clause and where clause params in VOImpl class rather than creating directly in CO. All rights reserved .  Exception Handling : Proper exception handling is a must.  Better to call sequences from the create method of EO rather than calling them from custom methods in AM. To get the value.e to expand the tree structure upto nth child). while(vo. Infact.setAutoExpansionMaxLevels(n). use the following syntax : hgridBean. Syntax : hgridBean. But you don’t have to set any where clause or where clause params and should directly execute the query. use getSelectFlag instead of getAttribute(n).reset(). AppsLead. To expand the hgrid upto nth level by default (i.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 get/set<Attribute_name> method instead of getAttribute(index) method. set all the default values or who columns for attributes here only.hasNext()){ // get handle of the vo’s current row and perform ur operations. isLoggingEnabled(4)) { pageContext. }catch(Exception _exception) { throw OAException.wrapperException(_exception). 4).  Calling AM methods in CO : Those of you who have used invokeMethod() in CO to call the AM methods might have observed that it’s the most tedious way of calling methods. Importing the AMImpl class in your controller allows you to access the AM methods directly without the use of invokeMethod() but it breaks the basic OAF standards coz u r accessing a class in the server package from a class in the webui package. Example for getting the object of the interface : Copyright © 2013. } Do not catch your exceptions wherever they occurred (ex in AM).writeDiagnostics(getClass(). To overcome the above. that will be caught and will not be shown to the user. } Use the following syntax for logging your exception in the log file if(pageContext. “ERROR_MSG”). double click on the AM . the best practice is to create an Interface of the AMImpl (which neither belongs to server nor webui) and use this AM Interface in your CO rather than AMImpl class. The exception must always be thrown back to the calling method .getName() +”. select ‘client methods’ and shuttle the required methods to right side. have to throw OAException anywhere. All rights reserved . So all the exceptions must be finally caught in the CO. It automatically creates an interface for you with the selected methods. Hence use the following statement in the catch block to throw the OAExceptions to the user : try{ throw new OAException(“APP_CODE”.which is in try-catch block. “Exception Details : “. To create an interface in Jdeveloper. AppsLead.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 code in proper try –catch blocks wherever possible. If your code . especially when you have to send serialized parameters.processFormRequest”. works in concert with a child table. All rights reserved . The underlying search must be executed by the developer. the Advanced search region includes a Clear button. depending on its configuration.webui. OA Framework automatically generates an oracle. 1] resultsBasedSearch:     OA Framework automatically renders both the Simple and Advanced search regions based on the designated queryable items in the associated table. 2] autoCustomizationCriteria: Copyright © 2013.   The search regions automatically include a Go button.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 XXWPHomeWorkPlanAM workPlanHomeAM = (XXWPHomeWorkPlanAM)pageContext. OA Framework automatically generates buttons as appropriate for toggling between the applicable regions.OAQueryBean which.fin dApplicationModule(“XXWPHomeWorkPlanAM  Understanding Query Regions When you add a query region to a pageLayout region. developers must explicitly define mappings between items in the Search panel and items in the table region.layout. OA Framework automatically executes the underlying search when the user selects the Go button.apps. In the above example we have used ‘resultBasedSearch’construction mode.beans.framework. 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. AppsLead.  Construction Modes: There are three construction modes available. In addition.fnd. You must implement your own Go button in this mode.getApplicationModule(webBean). However. advanced table or HGrid to implement any combination of simple search. Here is a brief comparison of the three modes. advanced search and view panels. 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. OA Framework automatically executes the underlying search when the user selects the Go button. The search regions automatically include both a Go and a Clear button. CONFIRMATION).apps.fnd. In this case.fnd. The message box is titled “Confirmation.WARNING. 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. You can register or throw multiple exceptions.putDialogMessage() method. All rights reserved .framework.webui.OAException object and set the kind of message you want (other options are OAException. 1 OAException message = new OAException("You cannot create a new change order when a Draft version already exits.OAPageContext interface. Here you need to construct an oracle.apps.framework.ERROR).". the OA Framework simply ignores the confirmation message(s). however. show confirmations with warnings.OAPageContext forwardImmediately*() method. 2 pageContext. 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.fnd.” and it contains both types of messages. the OA Framework combines them into a single message box using the following rules:    Since an error is more important than a warning.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 OAException Message and Dialog Page in OA Framework 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. Confirmations and errors cannot be shown together. OAException. 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. Then you can simply identify this exception for display when the page renders by calling the OAPageContext. Copyright © 2013.apps.framework. The OA Framework immediately stops processing the page and issues a forward before displaying the messages.INFORMATION and OAException.apps.OAException. you need to call the appropriate oracle.webui.fnd. You can.framework.OADialogPage class and oracle.putDialogMessage(message). the message box is titled “Error” if both errors and warnings exist.webui. AppsLead. ERROR.redirectToDialogPage methods.null). 06 dialogPage.setPostToCallingPage(true). To create a dialog page object.util. All rights reserved . message.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 The OADialogPage class holds properties for the generic dialog page.Hashtable(1).").redirectToDialogPage(dialogPage). 01 // To Diaplay the Exception on a Dialog page 02 OAException message = new OAException("You cannot create a new change order when a Draft version already exits. then put “” instead of null in the OADialogPage dialogPage = new OADialogPage line. To navigate (redirect) to a dialog page.util. 07 08 dialogPage. 09 java. If you want 2 buttons (Say Cancel and Ok). 04 05 dialogPage. null. AppsLead. 03 OADialogPage dialogPage = new OADialogPage(OAException.setOkButtonLabel("Ok"). then use the setter methods provided in the class to set additional properties. 10 dialogPage. use the OAPageContext."". Copyright © 2013. The OAPageContext interface contains the context and state information specific for a client request. 11 pageContext.setFormParameters(formParams). first use the constructors to instantiate the basic properties.Hashtable formParams = new java.setOkButtonToPost(true). rather than manually re-doing them all again. This objective can be achieved by exporting the personalizations from the Development instance. 1. Ex: /oracle/apps/icx/por/wf/webui/ReqLinesNotificationsRN 2.tools. you may wish to automate the transfer of these changes to another instance. Get the Personalization Document info Run the following command in TOAD or other tools as APPS user 1 set serveroutput on 2 exec jdr_utils.listCustomizations('<full document name from step 1>').XMLExporter \ Copyright © 2013.xlf file for translations).tools. Use XMLExporter to export personalization document java oracle. or can invoke the XMLImporter/XMLExporter commands directly from the command line. This post provides the below detailed steps how to transfer personalizations from one instance to others using the XMLImporter/XMLExporter tool. you will need to use export/import each item individually that you wish to export. Get Document Name Go to the page you want to copy the personalization from and click the “about this Page” link at the bottom of the page.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 Deploying OAF Personalizations Using the Import/Export Command Line Tools After personalizing and testing framework pages in a Development instance. Example: 1 set serveroutput on execjdr_utils.jrad. then importing them to a different instance or instances You can either use the GUI interface in “Functional Administrator” (Personalization tab) to transfer personalizations. The command line Export tool is necessary if you wish to perform bulk translations of personalization documents.exporter.listCustomizations('/oracle/apps/icx/por/wf/webui/ReqLinesNot 2 ificationsRN').XMLExporter <personalization document from step #2> \ 2 -username "<username>" -password "<password>" \ -dbconnection "(description=(address_list=(address=(protocol=tcp) 3 (host=<host>)(port=<port)))(connect_data=(sid=<sid>)))" \ 4 -rootdir "<output directory>" 1 Example: 1 java oracle.exporter.xml file (or .xml.xml. Output: anonymous block completed /oracle/apps/icx/por/wf/webui/customizations/site/0/ReqLinesNotificationsRN Note: If there are multiple records returned by this command. AppsLead. You will see the page name with full path which starts with /oracle/apps/<prod>. 3. All rights reserved .jrad. The Export tool allows you to export a package or xml file (along with translation information) from the MDS repository of a database instance to a . You may also find there are records returned for seeded personalizations provided by Oracle which do not need to be exported. 1 java oracle.xml.tools. Open the file and you will able to view the personalizations that you have done. Use XMLImporter to import personalization document Run the below command in the Instance where you want to import your personalization.XMLImporter \ 2 <full path of the file you want to import> \ 3 -username "<username>" -password "<password>" \ -dbconnection "(description=(address_list=(address=(protocol=tcp) 4 (host=<host>)(port=<port>)))(connect_data=(sid=<sid>)))" -rootdir "<top level directory>" \ 5 -rootPackage "/oracle/apps/<prod>" Example: 1 java oracle.jrad.tools.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" Copyright © 2013.XMLImporter \ 2 $XXSCM_TOP/install/ReqLinesNotificationsRN. AppsLead. All rights reserved .xml will be created in the below path: XXSCM_TOP/install/oracle/apps/icx/por/wf/webui/customizations/site/0.importer.jrad. 4.Contact Us: 002 – 010 900 160 23 002 – 0100 62 62 837 /oracle/apps/icx/por/wf/webui/customizations/site/0/ReqLinesNotificationsRN -username apps -password w3lcome123 \ -dbconnection "(description=(address_list=(address=(protocol=tcp) 3 (host=myhost)(port=12345)))(connect_data=(sid=dev)))" -rootdir "$XXSCM_TOP/install" \ 2 Here one file named ReqLinesNotificationsRN.xml.importer.
Copyright © 2024 DOKUMEN.SITE Inc.