Login
Register

Home

Trainings

Fusion Blog

EBS Blog

Authors

CONTACT US

OA Framework - All Articles
  • Register

Oracle Gold Partners, our very popular training packages, training schedule is listed here
Designed by Five Star Rated Oracle Press Authors & Oracle ACE's.

webinar new

Search Courses

Now that we are able to Insert record into tables and search for records from a OAF screen, it makes sense that the OAF screen should allow us to update the records in the table as well. So, here it goes, below are the steps that shows updation of records in a table from a OAF screen.

Requirement: To update records in a table from OAF screen

Step 1: Complete creating a workspace and project as in Search Record article

Step 2: Create an Update action item

Right click on table region SearchRecordVO1 -> New -> Item

Set the properties of the item created as shown below:

update_image_properties_updaterecord_article7.png

 

 

 

Click on browse button for parameters under Client action pane and enter the parameter name and values

Name – updateColumn1

Value -- ${oa.SearchRecordVO1.Column1}

Name – updateColumn2

Value -- ${oa.SearchRecordVO1.Column2}

 

Step 3: Create a OA Components page

Right click on SearchRecord project -> click New -> select OA components under Web Tier -> select Page

Package: oaf.oracle.apps.fnd.searchrecord.webui

Page Name: UpdateRecordPG

Step 4: Set Page properties

Select on the UpdateRecordPG page and go to structure pane where a region of type 'pageLayout' and ID 'region1' is automatically created.

Click on region1 in structure page and set the project properties as in the below screenshot - set all the properties except the controller class, for now.

page_properties_updaterecord_article7.png

Step 5: Set new Controller

Select PageLayoutRN in the structure pane -> Right click on it -> Set new controller

Package: oaf.oracle.apps.fnd.searchrecord.webui

Controller name: UpdateRecordCO

This automatically sets the controller class property in UpdateRecordPG page properties.

Step 6: Create region in UpdateRecordPG

Right click on PageLayoutRN -> New -> Region

Now, this creates a new region of style header under PageLayoutRN

Select region1 - set the ID as MainRN and set the region style to messageComponentLayout

​Step 7: Create item in MainRN

Right click on MainRN > New > messageTextInput

Set the properties of the item as in screenshot below:

column1_properties_updaterecord_article7.png

Create one another item similar to the above one and set it properties as below:

column2_properties_updaterecord_article7.png

Step 8: Add Apply and Cancel buttons

Right click on PageLayoutRN > New > Region

ID -> Buttons

Region Style -> pageButtonBar

Right click on Buttons -> New -> Item

Attribute Set -> /oracle/apps/fnd/attributesets/Buttons/Apply

Enter the properties for the item as in the below Screenshot

Apply_btn_insertrecord_article5.png

Similarly create one more item for Cancel button

Attribute Set -> /oracle/apps/fnd/attributesets/Buttons/Cancel

Enter the properties for the item as in the below Screenshot

 

Cancel_btn_insertrecord_article5.png

Step 9: Add a return navigation link to UpdateRecordPG

PageLayoutRN -> New -> returnNavigation

ID –> return

Set Destination URI as -> OA.jsp?page=/oaf/oracle/apps/fnd/searchrecord/webui/SearchRecordPG&retainAM=Y

Text –> Return to SearchRecordPG

Final page layout looks as below:

update_page_layout_updaterecord_article7.png

Step 10: Add the below code in SearchRecordCO:

PFR:

 

     if ("update".equals(pageContext.getParameter(EVENT_PARAM)))

      {

       pageContext.setForwardURL("OA.jsp?page=/oaf/oracle/apps/fnd/searchrecord/webui/UpdateRecordPG", null, OAWebBeanConstants.KEEP_MENU_CONTEXT,                        null, null, true,                           OAWebBeanConstants.ADD_BREAD_CRUMB_NO, OAWebBeanConstants.IGNORE_MESSAGES);

      }

Step 10: Add the below code in SearchRecordAMImpl

 

 

   public void updateRow(String Column1, String Column2)

   {

    SearchRecordVOImpl vo = (SearchRecordVOImpl)getSearchRecordVO1();

    vo.initQuery(Column1, Column2);

   }

       

   public void apply()

   {

    getTransaction().commit();

   }

 

   public void rollback()

   {

    getTransaction().rollback();

   }

Step 11: Add the below code in SearchRecordVOImpl

 

   public void initQuery(String Column1, String Column2)

   {

    if ((Column1 != null) && (!("".equals(Column1.trim()))))

    {

     setWhereClause("column1 = :1 AND column2 = :2");

     setWhereClauseParams(null); // Reset always

     setWhereClauseParam(0, Column1);

     setWhereClauseParam(1, Column2);

     executeQuery();

    }

   }

Step 12: Add the below code in UpdateRecordCO

PR:

 

     OAApplicationModule am = pageContext.getApplicationModule(webBean);

 

     String Column1 = pageContext.getParameter("PColumn1");

     String Column2 = pageContext.getParameter("PColumn2");

     Serializable[] params = { Column1, Column2 };

     am.invokeMethod("updateRow", params);

PFR:

 

     OAApplicationModule am = pageContext.getApplicationModule(webBean);

           

     if (pageContext.getParameter("Apply") != null)

     {  

      am.invokeMethod("apply");

       OAException message = new OAException("Record has been Updated successfully!", OAException.INFORMATION);

       pageContext.putDialogMessage(message);

     }

     else if (pageContext.getParameter("Cancel") != null)

     {  

      am.invokeMethod("rollback");

      pageContext.forwardImmediately("OA.jsp?page=/oaf/oracle/apps/fnd/searchrecord/webui/SearchRecordPG", null,                                      OAWebBeanConstants.KEEP_MENU_CONTEXT, null, null, false, // retain AM OAWebBeanConstants.ADD_BREAD_CRUMB_NO);

     }

Result:

Search for data and click on update pencil icon in column 3:

result_search_record_updaterecord_article7.png

 

result updatepg_on_page_load_updaterecord_article7.png

 

Update record for column2 from efgh to pqrs:

result_change_to_pqrs_updaterecord_article7.png

 

Hit Apply:

result_update_success_updaterecord_article7.png

 

Return back to search page to see the updated result:

result_on_return_updaterecord_article7.png


Roopa jetR

Comments   

0 #1 sandeep1 2015-05-15 10:38
Getting lot of errors
Error(15,10): duplicate definition of method initQuery(java. lang.String, java.lang.Strin g, java.lang.Strin g) in class xxapps.oracle.a pps.fnd.M_Searc hRecord_1.serve r.M_SearchRecor d_1VOImpl
OAException message = new OAException("Re cord has been Updated successfully!", OAException.INF ORMATION);

private class OAException {
Quote

Add comment


Security code
Refresh

About the Author

Roopa jetR

Roopa jetR is an budding OAF developer.

LinkedIn contact: https://www.linkedin.com/in/roopajetR

Search Trainings

Fully verifiable testimonials

Apps2Fusion - Event List

<<  Apr 2024  >>
 Mon  Tue  Wed  Thu  Fri  Sat  Sun 
  1  2  3  4  5  6  7
  8  91011121314
15161718192021
22232425262728
2930     

Enquire For Training

Related Items

Fusion Training Packages

Get Email Updates


Powered by Google FeedBurner