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
- Is it possible to logout Primavera P6 through SQL Query? - February 16, 2018
- How to Create Primavera P6 EPPM Database schemas in Microsoft SQL Server - February 15, 2018
- Configure Windows Firewall for Microsoft SQL Server 2017 – Part 4 - February 14, 2018