ADF delete row programmatically
In this section, I have explained deleting a record from an ADF table programmatically. I have used the Country table in HR schema for this example.
ADF delete row programmatically – Started
In my ADF model project, I have created EO and VO of the country table. The following methods in the AppModuleimpl java class will delete the selected row and first record
removeCurrentRow() => removes the record the user is viewing at the time .
removeFirstRow() => Removes first record in the table
Expose this method
We need to expose this method to make it available for UI. The below step is doing the same.
Double click on the AppModule.xml file >> Click Java >> Click the pencil icon >> Drag that method to the selected column as shown below & click Ok
1. Right click the APpModule.xml and click Run
2. An appmodule wizard appears on the screen. Double click on the CountryEOView1 object. You will get the Argentina as the record loaded on the screen similar to below
3. Double click on the AppModule >> Select removeCurrentRow() >> click execute . The Argentina is the current record you are viewing got deleted.
4. To check this, double click the CounryEOView1 again, you will see Australia is loaded and no more Argentina
Double click on the AppModule >> Select method removeFirstRow >> Click Execute. You will get the below error pop up saying about the foreign key violation because the record has been used by some other table.
The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.
Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply 🙂
Latest posts by Govind
- P6 Progress Reporter completely integrated into P6 Team Member - August 15, 2017
- Primavera P6 Professional for EPPM Popup 16.2 : The appropriate industry for your organization has not yet been select in admin preferences - August 15, 2017
- Primavera P6 Background Job Error:Creating job Symon Failed to add Database Job, Check the settings table for valid interval values for dbms_scheduler - August 14, 2017