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, search for records and update table records from a OAF screen, let us find out steps to delete a record in the table from a OAF screen. So, here it goes, below are the steps that shows deletion of records in a table from a OAF screen.

Requirement: To delete records of a table from OAF screen

Step 1: Complete creating a workspace and project as in Search Record article. Also refer to Update Record article

Step 2: Create a Delete action item

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

Set the properties of the item created as shown below:

Image URI –> deleteicon_enabled.gif

Atribute Set -> /oracle/apps/fnd/attributesets/Buttons/Delete

delete_action_properties_deleterecord_article8.png

 

 

 

Click on browse button for parameters under Client action pane and enter the parameter name and values as in the below screenshot:

Name – deleteColumn1

Value -- ${oa.SearchRecordVO1.Column1}

Name – deleteColumn2

Value -- ${oa.SearchRecordVO1.Column2}

Step 3: Add the below code in SearchRecordCO:

PFR:

 

     OAApplicationModule am = pageContext.getApplicationModule(webBean);       

     if ("delete".equals(pageContext.getParameter(EVENT_PARAM))) {

                OAException message = new OAException("Are you sure you want to delete this row?",OAException.WARNING);  

                pageContext.putDialogMessage(message);

                

                OADialogPage dialogPage = new OADialogPage(OAException.WARNING, message, null, "", "");          

                String yes = pageContext.getMessage("AK", "FWK_TBX_T_YES", null);

                String no = pageContext.getMessage("AK", "FWK_TBX_T_NO", null);

                dialogPage.setOkButtonItemName("DeleteYesButton");

                dialogPage.setOkButtonToPost(true);

                dialogPage.setNoButtonToPost(true);

                dialogPage.setPostToCallingPage(true);

                dialogPage.setOkButtonLabel(yes);

                dialogPage.setNoButtonLabel(no);

                

                pageContext.redirectToDialogPage(dialogPage);

           }

             else if (pageContext.getParameter("DeleteYesButton") != null) {

                  am.invokeMethod("deleteRecord", null);

                  OAException confirmation = new OAException("Record deleted Successfully", OAException.CONFIRMATION);

                  pageContext.putDialogMessage(confirmation);

             }

Step 4: Add the below code in SearchRecordAMImpl

 

   public void deleteRecord()

   {

   OAViewObject vo = getSearchRecordVO1();

     SearchRecordVORowImpl row = null;

     int fetchedRowCount = vo.getFetchedRowCount();

    RowSetIterator deleteIter = vo.createRowSetIterator("deleteIter");

     if (fetchedRowCount > 0)

     {  deleteIter.setRangeStart(0);  

        deleteIter.setRangeSize(fetchedRowCount);

        for (int i = 0; i < fetchedRowCount; i++)

       {

         row = (SearchRecordVORowImpl)deleteIter.getRowAtRangeIndex(i);

         row.remove();

         getTransaction().commit();

         break;

       }

     }

    deleteIter.closeRowSetIterator();

   }

Result:

Search for data and click on delete icon in column 4:

Deletion confirmation page comes up - click Yes:

Deletion confirmation message:

Search for val1 to see that no result comes up indicating the successful deletion of record.


Roopa jetR

Comments   

0 #1 pharmacepticacom 2021-06-24 02:51
erectile supplements that work https://pharmaceptica.com/
Quote
0 #2 hydroxchloriquine 2021-08-08 06:47
natural chloroquine https://chloroquineorigin.com/# hydroxychloroq
Quote
0 #3 yjaorz 2022-05-06 10:00
hydroxichloraqu ine https://keys-chloroquinehydro.com/
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