Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ODATA update

WFlats
Participant
0 Likes
1,667

Hi,

I'm using web IDE Full Stack, SAP UI5 and a HANA db service.

Creating entities with the app works fine. But I receive errors during the update operation.

onTaskStatePress: function () {

var oModel = this.getView().getModel(),
oViewModel = this.getModel("taskView"),
sPath = oViewModel.getProperty("/sTaskPath"), // sPath is "/Tasks(2)"
oTask = oModel.getObject(sPath);
// change some data, e.g.
oTask.started = true;
oModel.update(sPath, oTask);

This throws an error like: HTTP Status 503 - No application is available to handle this request

If I try this instead of oModel.update:

oModel.setProperty(sPath, oTask);
oModel.submitChanges();

Then I receive this error at oModel.setProperty: Assertion failed: Tasks(2) is not a valid property path

The oModel.submitChanges throws the error: "Illegal argument for method call with message 'Tasks(2)'." (500 Internal Server Error)

In the logs I find an error like: org.apache.olingo.odata2.api.ep.EntityProviderException: Illegal argument for method call with message '__ref'.","\t... 56 more"] }

sPath and oTask look correct. Any idea what's wrong with my code?

Wolfgang

2 REPLIES 2
Read only

0 Likes
934

Check the server side update operation? Is it running fine or not?

Read only

WFlats
Participant
0 Likes
934

Hi Krushna,

thanks.

I can update the entity using Postman/PATCH without a problem.