cancel
Showing results for 
Search instead for 
Did you mean: 

can send an error message in the update method odata my service?

Former Member
0 Kudos

Hi,

I need to send an error message if my update does not work

can I do that?

lt_return, return message error

How does what I can get in my app?

thank you,

regards

Accepted Solutions (1)

Accepted Solutions (1)

ChandraMahajan
Active Contributor
0 Kudos

Hi,

This discussion belongs to SAP Gateway space and hence moving it to that space.

for your question, please refer and

Regards,

Chandra

Former Member
0 Kudos

Hi Chandra,

thanks for your quick response

is correct but

how can I get and show my error in my app sapui5?

regards,

Axel

kedarT
Active Contributor
0 Kudos

Hi Alex,

Hope this helps:

var oEntry = {};

oEntry.Price = "599$";

oModel.update('/Products(1)', oEntry, null, function(){

  alert("Update successful");

  },function(){

alert("Update failed");});

Look at this - OData Write Support - What's New in SAPUI5 - SAP Library

Former Member
0 Kudos

Hi Kedar,

ok is correct

but what I want is to show my error messages lt_return

because that generates an error

regards

kedarT
Active Contributor
0 Kudos

Hi Axel,

For error function there is a parameter oError can you check in debugging what information does it return. Use below code:

var oEntry = {};

oEntry.Price = "599$";

oModel.update('/Products(1)', oEntry, null, function(){

  alert("Update successful");

  },function(oError){

console.log(oError);

});

Look at the update method here - SAPUI5 SDK - Demo Kit

Answers (0)