cancel
Showing results for 
Search instead for 
Did you mean: 

How to use batch for Multiple Get EntitySet from SAPUI5?

Jayakrishnan
Active Participant
0 Kudos

Hi All,

I have to use oModel.read to get two different entityset in a batch operation? i used th below code to execute it. But when i do the debug in the back end, it does not trigger the change set begin&end method. (both were implemented in the DPC). but It is getting triggered simultaneously. Please suggest me to do in a right way.

Code:

		oModel.setDeferredGroups(["batchget"]);
			oModel.read("/EntitySet_01", {
				groupId: "batchget",
				changeSetId: "batchget",
				success: function (oEvent) {
					
				},
				error: function (oError) {
					
				}
			});
			oModel.read("/EntitySet_02", {
				filters: aGroupFilters,
				groupId: "batchget",
				changeSetId: "batchget",
				success: function (oEvent) {
					
				},
				error: function (oError) {
					
				}
			});
			oModel.submitChanges({
				groupId: "batchget",
				success: function () {
					alert("success");
				},
				error: function () {
					alert("Error");
				}
			});

Thank you,

Regards,

Jayakrishnan.C

Accepted Solutions (1)

Accepted Solutions (1)

maheshpalavalli
Active Contributor

Changeset related methods are supposed to be triggered only for CUD related operations and read requests related methods will be called separately even though they are in the same batch request.

Any reason why u want them in same cchangeset

Thanks
Mahesh

Jayakrishnan
Active Participant
0 Kudos

Thanks maheshkumar.palavalli

Not Specific reason, i thought of combining both get entityset call in a single request to avoid two time service call to the back end.

My design is like below,

I have table_01 with single select. after selecting the row, it should open other two tables in the below . Both below table collections are associated with the first table row id.

So i thought combining both service request.

maheshpalavalli
Active Contributor
Jayakrishnan
Active Participant
0 Kudos

Thank you, maheshkumar.palavalli. i will try that

Answers (0)