Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Passing array using oModel.create()

$
0
0

Hi guys.

Is there a way to send an array using oModel.create() function ?

I use below code but I use create function twice for two records :

 

var oModel = new sap.ui.model.odata.ODataModel("MyServer:8000/sap/opu/odata/sap/MyCollection/");
var oEntry = [];  oEntry.push(  {  Name : "My Name",   LastName : "My Last Name"  });
 oEntry.push(  {  Name : "My Name 2",   LastName : "My Last Name 2"  });
oModel.create('/PersonsSet', oEntry[0], null, onSuccess, onError, true);
oModel.create('/PersonsSet', oEntry[1], null, onSuccess, onError, true);

 

I tried below code but I received the following error  :

ValueSystem expected the element '{http://www.w3.org/2005/Atom}entry'

 

oModel.create('/PersonsSet', oEntry, null, onSuccess, onError, true);

 

How to send array using create function 1 times ?


Viewing all articles
Browse latest Browse all 6178

Trending Articles



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