cancel
Showing results for 
Search instead for 
Did you mean: 

How to create odata service for update records?

Former Member
0 Kudos

Hello experts,

                     I am creating an app in SAP UI5 for EMR. In that I will get some input from Doctor for prescription. So I need to update this record in my database after clicking Save button in my app. I am creating ODATA Services for app in Eclipse Kepler using model entities. So how can I create odata service for this after clicking Save button. Plz help me.

Accepted Solutions (0)

Answers (2)

Answers (2)

santhu_gowdaz
Active Contributor
0 Kudos
joao_sousa2
Active Contributor
0 Kudos

For example:

var busy = new sap.m.BusyDialog({ text:"Saving..."});

busy.open();

oModel.create('/EntitSet', object, null,

    function(){

        busy.close();

            },

    function(oError){

        var model = new sap.ui.model.json.JSONModel();

        model.setJSON(oError.response.body);

        sap.m.MessageToast.show(model.getData().error.message.value);

        busy.close();

    }

);

oModel refers to your oDataModel object, and "object" refers to the entity you want to create. This object is just a Javascript object with properties compatible with the odata model entity you are creating.