79215302

Date: 2024-11-22 14:03:53
Score: 1
Natty:
Report link

sapui5 documentation of submitBatch method

The Promise you get from submitBatch Throws an error if its not succesful. You have to pass it a second function where you handle the error.

oModel.submitBatch("cmpchange").then(
    function (oEvent) {
        let messages = this.oContext.getBoundContext().getMessages();
        if (messages.length > 0) {
            let oJSONModel = new JSONModel();
            oJSONModel.setData(messages);
            this.oMessageView.setModel(oJSONModel);
            this.oMessageDialog.open();
        }
    },
    function (oError) {
        // here you get the error in oError
    }
)
.bind(this);
Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Marvin Ingel