on 12-22-2014 6:17 PM
Hi, I am trying to implement a CUD app for a while now and have chosen to go the oDATA route
Reading data is has been an easy one
While I though create update and delete would ply the same road, I guess its another ball game,
How can you assist with
var oModel = new sap.ui.model.odata.ODataModel("http://myServer/Sentiments/services/contacts.xsodata");
oModel.remove('/ContactsList(1)', null, function(){
alert("Delete successful");
},function(){
alert("Delete failed");});
I get a failed Alert, Imagine that, What COuld i be doing wrong, permissions, security, headers...etc
This is all I have in my contacts.xsodata file service namespace "sap.hana.contact.service" { "SYSTEM"."BMBFRIENDS" as "ContactsList"; } Below is the example I want to test with as shown in the API reference
DELETE http://server/Sentiments/services/contacts.xsodata/ContactsList(1) 400 (Bad Request)d
Thanks for your help
And Yes I have Solved this problem by taking a very good rest before reading the documentation
Remember to do a forced clear cache especially in Chrome
The correct URL should be
http://server/Sentiments/services/contacts.xsodata/ContactsList('1')
code
var oModel = new sap.ui.model.odata.ODataModel("http:/mySecretIP/Sentiments/services/contacts.xsodata",false);
oModel.remove("/ContactsList('1')", null, function(){
alert("The Delete successful");
},function(){
alert("The Delete failed");});
Where contacts.xsodata is the name of .xsodata definition file
and /ContactsList is the alias name you gave to your database, view or datasource if you are using HANA
Hope this help me in the future or you presently
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.