Skip to Content
0
Oct 16, 2019 at 10:15 AM

How to pass odata service data to View passing key

71 Views

Hi I have a service and i want to bind that service to View.

I am trying var oMod = this.getOwnerComponent().getModel();

oMod.read("/AgreementReqHeaderSet('F000028993')", { success: function (oData) {

var oJsonModel = new JSONModel(); oJsonModel.setData(oData);

this.getView().setModel(oJsonModel,"Agr"); }.bind(this), error: function (oError) {

MessageToast.show("Read Failed"); }

});

getting error

Uncaught TypeError: Cannot read property 'read' of undefined

Please guide me . Am i using correct approach ? Please correct if any ...