Quantcast
Channel: SCN: Message List - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 8124

update function error

$
0
0

Hi everyone,

 

I am trying to update STATUS field in my database using update function but its showing the error "Cannot read property 'Context' of null".

Can you help me with this kind of error.

 

javascript Code

Reject : function(){

  var as = sap.ui.getCore().byId("idadmin1--idProductsTable").getSelectedItem().getBindingContext().getObject();

  as.Status="Rejected";

  var oEntry = {};

  oEntry.Empid = as.Empid;

  oEntry.Status = as.Status;

  sap.ui.getCore().getModel().update("/leave_set('" + oEntry.Empid + "')",oEntry, null);

  }

 

DATA: ls_user   TYPE zleave.

 

     io_data_provider->read_entry_data( IMPORTING es_data = ls_user ).

     UPDATE zleave SET

       status = ls_user-status

 

       WHERE empid = ls_user-empid.

 

     er_entity = ls_user.

above is the code from update_entity method.

 

Thank you

Anshul D


Viewing all articles
Browse latest Browse all 8124

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>