Skip to Content
avatar image
Former Member

Binding $batch in sap UI5

I was trying to call a $batch operation from my application and it should be during the initial load.so i put the batch operation inside the Component itself but the batch is not getting trigger in the network. and how to bind different entityset with different controls once batch is called. i know how to bind them in normal.

	oModel.setUseBatch(true);
			var batchChanges = [];
			batchChanges.push(this.oModel.createBatchOperation("/BusinessPartnerSet" , "GET"));
			batchChanges.push(this.oModel.createBatchOperation("/ProductSet" , "GET"));
			batchChanges.push(this.oModel.createBatchOperation("/SalesOrderSet" , "GET"));
			
			
			oModel.addBatchReadOperations(batchChanges);
this.oModel.submitBatch();
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Apr 28, 2017 at 04:18 PM

    why are you not using V2 model ??, in V2 model system automatically takes care of batch

    Add comment
    10|10000 characters needed characters exceeded

    • If binding is done in XML view then batch operation is triggered automatically when the view is instantiated.

      Another option is like a AJAX call using the method read where you have the control to send the request(Note: in this case you need to set the data to model manually)

  • avatar image
    Former Member
    May 01, 2017 at 06:47 PM

    There are 2 references to your model as per the code that you've posted here.

    1. oModel and 2. this.oModel.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Sakthivel,

      there is just one oModel object which i have created in my program and i am just calling the oModel object with this keyword. Please advice if i am commeting any mistake. my intension is to trigger batch operation during the intial launch of the app, is this feasable and my next doubt is how i will separate different entityset once i get it in a batch .

      Thanks in advance.