Skip to Content
avatar image
Former Member

sapui5 odata remove deep entity

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"

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Feb 19, 2018 at 06:16 AM

    Hi Shweta,

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

    Regards,

    Nitin

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 24, 2018 at 02:07 PM

    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

    Add comment
    10|10000 characters needed characters exceeded