She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

Create collections of data into db

Good Day Team!

Im trying to insert a collections of data into db from localStorageVariable(Array)
but always one record added to the database not all the data. please help.
Screenshot is in below:

this is the collections of data from LSV:

Image

and this is the mapping of Create into db:

Image

Thank you,

Ihor Didevych
Posts: 0
Joined: Wed Nov 19, 2014 7:55 pm

Create collections of data into db

Hi,

Create function in DB are not for bulk objects.
You can create only one object at once.
To make it work you should call your service loop.

She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

Create collections of data into db

Hi Lhor,

I have this code and still nothing happens:
this code is in button Click event

var storage = localStorage.getItem('_notloggedArray');

for(i=0;storage.length < i;i++){
CreateMap.execute();
}

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Create collections of data into db

Please try to debug your code first.
Do you get any error in console?

Return to “Issues”