Hawk
Posts: 0
Joined: Mon Aug 04, 2014 11:23 am

Reading multiple DB records into storage model

Hi Alena,
I already had a look at it. It is the same link I posted above. The problem is in the documentioan the example is about set value to storage variable only. There is no example on how to set value to storage variable as a part of storage model. My storage model has a variable "UserName". Hkw can set value to this variable?

Hawk
Posts: 0
Joined: Mon Aug 04, 2014 11:23 am

Reading multiple DB records into storage model

My model is as follows:

Image

And this is the storage:
Image

So how can I refer to "UserName" ? . In the tutorial there is something like this:

preApperyio.storage.MS_Outlet_Details.set("Sam Dean")/pre

This does not work for me, as MS_Outlet_Details is an object of the type "Outlet_Details". Besides, I tried the following;

preApperyio.storage.MS_Outlet_Details.UserName.set(UserName); /pre

I return the error "cannot use "set" with undefined".

So, I need to set value to the property "UserName" in the object "MS_Outlet_Details".

Thanks

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Reading multiple DB records into storage model

Hi Hawk,

Here is a code to set property inside the storage object.

pre

//Get object
var storageObject = Apperyio.storage.MS_Outlet_Details.get();

//Set object property
storageObject.UserName = UserName;

//Store storage object
Apperyio.storage.MS_Outlet_Details.set(storageObject);

/pre

Regards.

Blair Cox
Posts: 0
Joined: Thu Jun 04, 2015 2:29 pm

Reading multiple DB records into storage model

Doesn't work for me - having the same issue where I want to pull back an array in local storage in order to walk through the list and pass values to Google Map in order to drop markers (per the tutorial). But it returns only [Object] rather than values/names. The code you provide here seems incomplete. Specifically, how to properly set the object property.

Thanks!

Return to “Issues”