I am deferring a delete request using v2 odata model:
this._oModel.setDeferredGroups(["TechObjDelete"]);
this._oModel.remove("/TechnicalObjectSet(EquipmentNo='" + oItem.EquipmentNo + "',Job='" + oItem.Job + "')", {
groupId: "TechObjDelete",
changeSetId: oItem.EquipmentNo,
success: function(oData) {
},
error: function(oError) {
}
});
And want to process with the deletion when the user click the "Save" button. So on save I call:
this._oModel.submitChanges();
And it all works fine. The problem is when the user doesn't click on "Save" button but moves to another screen. I then would like to reset the deferred changes in the model.
I could do that by initializing the following property as it stores the deferred requests:
this._oModel.mDeferredRequests = {};
But this is accessing the private property of the model. Is there a better way to reset it?