Skip to Content

Extract specific records after ODATA MODEL retrieved data from back end

Sep 15, 2017 at 06:24 PM


avatar image

Hi Experts,

How to read specific data from the NAMED data model( here i have used V2 odata Model using XML view and MANIFEST file) once data is retrieved successfully from the backend. i am able to retrieve data using table.bindrows. This is all fine.

Now once data is available under NAMED data model, now i want to read specific records from this named data model. How to achieve this?



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

1 Answer

Rahul Gupta Sep 16, 2017 at 01:45 PM
oModel = this.getView().getModel("myModel");"/EntitySet", {success: function(oData){
                                        //do the required 

You can call read method of odata model and after successfully reading data, the success call back function will get executed, inside this function you have the model data in the input parameter oData, which is a JavaScript object, now you can use this object to read any specific data.



Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Rahul,

If i do as suggested then how can i bind the data to table. i am first retrieving the data using TABLE.BINDROWS and displaying data in table. Once this is done then i want to extract data from NAMED model.

if i first retrieve data using, then how can i bind the data to table from success call back function?

here is the scenario:

In the first page i have 3 different radio buttons which indicates different years like 2015,2016 and 2017. When i click on first radio button(2015), then odataModel brings the 2015 related data and stores in NAMED model. When i go back and click on second radio button(2016), then odataModel brings the 2016 related data and stores 2016 ALONG WITH 2015 data in NAMED model. But i want only 2016 data to be available in the named model(not 2015 data). How to achieve this?




Use filters in odata service.