Skip to Content
avatar image
Former Member

oData batch operation on multiple DIFFERENT EntitySets

Hi, I have a gateway WebService which has multiple EntitySets (let's say 10 of them) and was wondering if it is possible to post all the data for all entitisets in one batch operation like below:

var batchChanges = [];
batchChanges.push(oModel.createBatchOperation("/MainDetailsCollection", "POST", oMainDetails));
batchChanges.push(oModel.createBatchOperation("/OrgLocationCollection", "POST", oOrgLocationDetails));
        
oModel.addBatchChangeOperations(batchChanges);
oModel.submitBatch(function(data){
    oModel.refresh();
    console.log("success?: " + data);
},function(err){
    alert("error occurred: " + err);
});

So far the moment I try to push a different entityset i immediately get CX_SXML_PARSE_ERROR. So is the batchChanges only ment for posting multiple lines of a SINGLE entity set?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Aug 12, 2015 at 08:32 AM

    Hi,

    Yes you can club multiple operations in a single network call using $batch. These operations can be on multiple entitysets of the same service. You can find more details here: $batch implementation of multiple operations on multiple entitysets in a single call

    Regards,

    Ekansh

    Add comment
    10|10000 characters needed characters exceeded