I would like to know when I use the submitChanges
of sap.ui.model.odata.v2.ODataModel
, and have a success and error callback function. Even if the request failed the success handler gets called.
My code example is below:
onSave: function() {
this.getModel().submitChanges({
success: function(oData, oReponse) {
//Do something for success
},
error: function(oError) {
//Do something for error
}
});
}