on 2022 Oct 22 2:10 PM
Dear All
I am submitting a UI5 based form data back to oData/ERP on Save Event. Requirement is, for example to stop creation of record, if employee has not completed 5 years of service, which is handled by raising oData exception message but App is also showing standard Fiori Technical Error instead of showing only user friendly error message.
Within OData create_entity method, exception is raised using /iwbep/cx_mgw_busi_exception whereas within controller UI below code is written. However, system is showing standard Technical Error, in addition to customized error raised using oData exception,
oModel.submitChanges({
success: function(oData, oResponse) {
if (oData.__batchResponses[0].response.statusCode >= 400) {
var oResp = JSON.parse(oData.__batchResponses[0].response.body);
MessageBox.error(oResp.error.message.value);
this.getModel("appView").setProperty("/busy", false);
}
},
error: function(oError) {
this.getModel("appView").setProperty("/busy", false);
}
});<br>
Request clarification before answering.
Hi Adnan,
If you are looking to handle the errors on the model level, check:
https://ui5.sap.com/#/api/sap.ui.model.odata.v2.ODataModel%23events/requestFailed
or
https://ui5.sap.com/#/api/sap.ui.model.odata.v2.ODataModel%23events/batchRequestFailed
Regards
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
12 | |
9 | |
8 | |
8 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.