cancel
Showing results for 
Search instead for 
Did you mean: 

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

0 Kudos

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) { } });

Accepted Solutions (0)

Answers (2)

Answers (2)

SergioG_TX
Active Contributor
0 Kudos

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

0 Kudos

Hey,

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

Thanks.