‎2019 Apr 02 8:49 AM
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
‎2019 Apr 02 12:03 PM
‎2019 Apr 02 2:56 PM
Hi Krushna,
thanks.
I can update the entity using Postman/PATCH without a problem.