Skip to Content

OData V2 Model batch call with get and update call in same batch

Hi,

I have tried calling OData V2 Model batch call with get and /update call in same batch. But it is not working.

var oModel = new sap.ui.model.odata.v2.ODataModel(serviceURL,true);

oModel.setUseBatch(true);

oModel.read(sPath, {groupId: "myId"});

oModel.update(sPathUpdate, poEntry, {groupId: "myId", changeSetId: "applyChange"});

oModel.submitChanges({ groupId: "myId", success: function (oData) { } });

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • 3 hours ago

    if you are trying to get the record first and then update the same.. you should try an async JS call... and GET the record first... and on your successcall back run the update operation... i think that is what you need to do to achieve your desired output

    Add comment
    10|10000 characters needed characters exceeded

  • 4 hours ago

    Hey,

    Did you get any solution for your issue? I have also faced this kind of scenario, but searching for the help.

    Thanks.

    Add comment
    10|10000 characters needed characters exceeded