Skip to Content
0

Filter error in oData model read from service

Nov 18, 2016 at 09:49 PM

46

avatar image

Hello.

I have defined a filter for a oData model. It checks whether the value of an input field (name) is contained within the filterable field of the model (Name2).

filnam = new sap.ui.model.Filter("Name2", sap.ui.model.FilterOperator.Contains, name.getValue(),"");

The read is executed afterwards storing the resulting records in a table

oModel.read("/ClientCollectionSet", {
					filters: filnam,
					method: "GET",
					success: function(oData) {
						var data = {
							"Row": oData.results
						};
						oJsonModel.setData(data);
						oJsonModel.setSizeLimit(500);
						var tbl = oView.byId("table2");
						tbl.setModel(oJsonModel);
						tbl.bindRows("/Row", tbl.getRows()[0].clone());
					},
					error: function() {}
				});

The model is declared this way

var oModel = new sap.ui.model.odata.ODataModel(odataUrl, false, false, false, {});

If I execute the read without filters it works OK, but with the filter it gives me this error.

Thank you in advance for any suggestion.

error-odata2.png (67.4 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers