cancel
Showing results for 
Search instead for 
Did you mean: 

sapui5 odata remove deep entity

0 Kudos

I am using oData reference services with read/write enabled. I am unable to delete entries with deep entity. For example I want to delete entries from entityset "Suppliers"

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi Shweta,

You are not able to remove entry from "Suppliers" entity set because E-tag is maintained in "Suppliers" Entity set, which is not implemented in "Products" entity set. You can observe an E-Tag property with each entry in the URL :

http://services.odata.org/V2/(S(eqkutk5sla1b31tgi5etl5e0))/OData/OData.svc/Suppliers


So now you have to call the remove function along with the E-tag parameter of that specific entry you are going to delete as given below :

oModel.remove("/Suppliers(2)", 
{
eTag : 'W/\"2\"' ,
success: function(oData, response) { sap.m.MessageToast.show("Success"); }, error: function(response) { sap.m.MessageToast.show("Failed"); } });

Please do let me know if any doubt.
Regards,
Nitin

0 Kudos

Hi Shweta,

Could you please describe the requirement in more precise way so that we can suggest you a solution.

Regards,

Nitin

0 Kudos

http://services.odata.org/V2/(S(eqkutk5sla1b31tgi5etl5e0))/OData/OData.svc/

Above link is for read/write data.

I want to delete either of the entries from entityset "Suppliers" using sapui5 odata remove function.

but simple code for deletion is not working the way it did for "Products" entity set

this.oModel.remove("/Products(" + delelement + ")",

function(oResponse){ console.log(oResponse); },

function(oResponse){ console.log(oResponse); });