Skip to Content

Count from OData Illuminator Services in SAPUI5

Mar 11 at 06:33 PM


avatar image
Former Member

Hi brother, i'm trying to do a count after applying a filter, but it always returns the total value of the rows, can you help?

// Create an object of filters
this._mFilters = {"inStock": [new sap.ui.model.Filter("UnitsInStock", "EQ", 1)];

// read the count for the unitsInStock filter
this.getModel().read("/Rowset(QueryTemplate=\'query\',RowsetId=1)/Row/$count", {
			success: function (oData) {
                        oViewModel.setProperty("/inStock", oData);
                        filters: this._mFilters.inStock

Always returns total rows, instead of count the result with the filter.


10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers