on 02-16-2018 5:40 AM
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"
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shweta,
Could you please describe the requirement in more precise way so that we can suggest you a solution.
Regards,
Nitin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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); });
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.