Skip to Content
0
K C
Apr 22, 2016 at 08:32 AM

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

8532 Views

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