Advertisement
ignatov

Untitled

Jun 14th, 2020
1,145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         onUpdate: function() {
  2.            
  3.             var oEntry = {};
  4.             oEntry.Id = sap.ui.core.Fragment.byId("EditFr2", "idPerson").getValue();
  5.             oEntry.ZzfirstName = sap.ui.core.Fragment.byId("EditFr2", "idfName").getValue();
  6.             oEntry.ZzlastName = sap.ui.core.Fragment.byId("EditFr2", "idlName").getValue();
  7.             oEntry.Active = sap.ui.core.Fragment.byId("EditFr2", "idChB").getSelected();
  8.            
  9.             var sUrl = "/sap/opu/odata/SAP/ZODATA_APP_10_SRV/";
  10.    
  11.             var oModel = new sap.ui.model.odata.v2.ODataModel(sUrl);
  12.             oModel.update("/PersonSet('" + oEntry.Id + "')", oEntry, {
  13.                 success: function(){MessageToast.show(" Entry was successfully updated");},
  14.                 error: function(oError){ if(oError) {MessageToast.show("Entry was not updated");}}
  15.             }
  16.             );
  17.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement