Skip to Content

"Uncaught TypeError: s is not a function datajs.js:17" after ODataModel update method in SAPUI5


I am having an issue with the update method of my ODataModel, I am trying to update property "Werks

" of AgentsSet entity. The update request returns 204, and the data is updated indeed, but right after it takes about 60s and then triggers an error as follows:

The count request works fine when I paste it separately as URL in the browser

Here is my code of the update method which happens after clicking the "save" button:

onSave: function (oEvent) {
	var aModel = this.getView().getModel();
	var aItem = this.getView().byId("list").getSelectedItem();
	var aEntry = {};
	aEntry.Werks = sap.ui.getCore().byId("editDiv").getValue();
        if (aEntry.Werks === "") {"sap.m.MessageBox");
		sap.m.MessageBox.alert("Champs vides!");
	} else {"/DivisionsSet('" + aEntry.Werks + "')", {
			success: function () {
				aModel.update("/AgentsSet('" + aItem.getBindingContext().getProperty().MatAgent + "')", aEntry, false, {
					success: function () {
					error: function () {"sap.m.MessageBox");
						sap.m.MessageBox.alert("Erreur inattendue!");
			error: function () {"sap.m.MessageBox");
				sap.m.MessageBox.alert("Division inexistante!");

I have tried to use setProperty() with submitChanges() instead of update() but it behaves the same way

aModel.setProperty("/AgentsSet('" + aItem.getBindingContext().getProperty().MatAgent + "')/Werks", aEntry.Werks);

Any ideas how to solve this problem?

Thank you in advance,

capture.jpg (194.2 kB)
capture.jpg (49.5 kB)
capture.jpg (48.8 kB)
capture.jpg (52.7 kB)
capture.jpg (43.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

0 Answers