cancel
Showing results for 
Search instead for 
Did you mean: 

SAP UI5 Delete operation not working

chengalarayulu
Active Contributor
0 Kudos

Hello there,

I've created an UI5 application with OData service, I am able to update the data which entered on application to backend via OData service. but couldn't delete the data in the same way. Getting below error message in log.

The Data Services Request contains SystemQueryOptions that are not allowed for this Request Type

below is my code: 
		deleteEntry: function(oEvent) {
			var oModel = oEvent.getSource().getModel();
			var oBindingContext = oEvent.getSource().getBindingContext();
			var sPath = oBindingContext.getPath();


			oModel.remove(sPath, {
				success: function() {
					MessageToast.show("Delete Success");
				},
				error: function() {
					MessageToast.show("Delete Failed");
				}
			});
			oModel.refresh();
		}

Accepted Solutions (1)

Accepted Solutions (1)

maheshpalavalli
Active Contributor

Hi Damal,

Please check what is the value in sPath right after the below statement:

var sPath = oBindingContext.getPath();

it should be in the format "/entityset(keyvalues)"

best regards,

Mahesh

chengalarayulu
Active Contributor
0 Kudos

Thanks Mahesh, it was my mistake - key values were not passing correctly.

Answers (2)

Answers (2)

vamsi_3333
Explorer
0 Kudos

Hi chengalarayulu.d,

Did you got any solution for the above issue ?
i am also facing the same issue..
Odata call is going well and also getting response Ok 200, but the record is not deleting from backend.
the same URI which is sending request to delete record is working fine in sap gateway client.

junwu
Active Contributor
0 Kudos
oModel.remove(sPath,{
				success:function(){
					MessageToast.show("Delete Success");
oModel.refresh();},
				error:function(){
					MessageToast.show("Delete Failed");}});
			

how about trying this?

chengalarayulu
Active Contributor
0 Kudos

Hi Jun, Thank you for your quick response. It didn't help - still the same - I can sense that model is getting refreshed but the deleted entry stays same.