cancel
Showing results for 
Search instead for 
Did you mean: 

Count from OData Illuminator Services in SAPUI5

pablosilva80
Explorer
0 Kudos
194

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?

http://server:port/XMII/IlluminatorOData/Rowset(QueryTemplate='query',RowsetId=1)/Row/$count?$filter=UnitsInStock%20eq%201

// 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.

Thanks

Accepted Solutions (0)

Answers (0)