cancel
Showing results for 
Search instead for 
Did you mean: 

Get Success / Error message from OData backend on update / Create operation

Karan_Chopra_
Active Participant
0 Kudos
12,015

Hello Experts

I am trying to get get message returned from backend system on successful update / create request, but the code returns nothings and when I check in debug mode it bypasses the success / error functions in oDataModel's create/update methods.

Below is my code:


var oServiceModel = this.getView().getModel();

var relPath = "/IssueDetailSet(" + "Memberid=" + "'" + memberid + "'" + "," + "Bookid=" + "'" + bookid + "'" + ")";

  // Call the update method of the service model

oServiceModel.update(relPath, oData, null, function(success) {

  MessageToast.show("Updated book " + success.Bookid);

   },

  function(error) {

  MessageToast.show(JSON.parse(error.response.body).error.message.value);

  });

at Backend Side I am passing data in UpdateEntityset to below Method

        COPY_DATA_TO_REF(

                exporting

                  IS_DATA = LS_REQUEST_INPUT_DATA

                changing

                  CR_DATA = ER_ENTITY

              ).

Date is going fine and update working fine but I am not sure how to get return Sucess message in JS above

View Entire Topic
vardhan_naik3
Explorer
0 Kudos
error: function (oError) {     
MessageBox.show(
JSON.parse(oError.response.body)["error"]["message"]["value"], {
							title: "Error"
						}
); --> outer