Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3548

Re: "Uncaught TypeError: Cannot read property 'getValue' of undefined"

$
0
0

Hi Jamie,

 

Thanks for your response,

 

While I am trying to do Create operation in CRUD I am getting error as

 

"Uncaught TypeError: Cannot read property 'create' of undefined"

 

Below is my code:

 

onCreateData: function() {

  this._Dialog = sap.ui.xmlfragment("idCreateFrag","venky.ui5crud.view.CreateUser",this);

  this._Dialog.open();

 

},

 

// onClose event handler of the fragment

onClose: function() {

  this._Dialog.close();

},

 

onSave: function() {

  var oEntry = {};

  var inputEmail = sap.ui.core.Fragment.byId("idCreateFrag","idIpEmail").getValue();

  var inputFirstName = sap.ui.core.Fragment.byId("idCreateFrag","idIpFname").getValue();

  var inputLastName = sap.ui.core.Fragment.byId("idCreateFrag","idIpLname").getValue();

  var inputAddress = sap.ui.core.Fragment.byId("idCreateFrag","idIpAddress").getValue();

 

  oEntry.Email = inputEmail;

  oEntry.FirstName = inputFirstName;

  oEntry.LastName = inputLastName;

  oEntry.Address = inputAddress;

 

  sap.ui.getCore().getModel().create("/UserSet", oEntry, null, function() {

     sap.m.MessageBox.show("Success");

  }, function() {

  sap.m.MessageBox.show("Error!");

  });

 

 

Below is my Entity type,

 

odata.jpg

I think problem might be related to Entity type properties annotations.

Please sugget me.

 

Message was edited by: Venkatesh Machineni


Viewing all articles
Browse latest Browse all 3548

Trending Articles



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