cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Records in Entity Service

Former Member
0 Kudos

Hi All

Please tell me the solution to delete the records that are in the Entity Service from the Web Dyn Pro side.

The case is :

I am having an entity service that conatins some records, now when I start my application again I want that Entity service to be empty that is all the records that were present in it earlier should be removed, so that I can add new records to it and that Entity service contains only the latest records added by me.

Thanks

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Create a query operation on enity which will return all enity, such as FindAll().

In

Use the proxy class removeAll(Collection c) function. In this function pass the proxy.findAll() return. This should solve your problem.

Former Member
0 Kudos

Hi Vivek

https://forums.sdn.sap.com/click.jspa?searchID=2456773&messageID=2400304

Message was edited by:

shobhendra srivastava

Former Member
0 Kudos

Hi Vivek

https://forums.sdn.sap.com/click.jspa?searchID=2456773&messageID=2400304

Message was edited by:

shobhendra srivastava

former_member4529
Active Contributor
0 Kudos

Hi,

Add an application service method deleteAll() which reads all the data in the entity service and then delete them one by one in a for loop.

Call that method in the wdDoInit() method of the WDP app using the CAF web dynpro model.

Thanks,

Dipankar

Former Member
0 Kudos

Hi

Thanks for the reply

I made an Entity Service and I am able to save record in it.

Now I want to delete all the records : 2 cases for that

1. Delete by passing the key - for that I have to make an Application Service and than delete from there.

2. All at once : for this I dont think that I have to make an Application Service.

May be there is some way by which this can be achieve through Entity Service only.

I am working on 2nd case:

I am able to delete it by passing the key but I want some other way by which I can delete all the records without passing any key so that the node size is equal to 0.

Can you help me in that.

Regards

Vivek

Former Member
0 Kudos

The solution for this is as below.

in the WdDoInit() method of your webdynpro use the proxy classes exposed by entitiy to delete the records.

The right approach would be to create ApplicationService which deletes all the records and call the Application Service in WdDoInit() method using proxy.