Mobile App - Data Synchronization - Static Entity.. Server or Local?

Mobile App - Data Synchronization - Static Entity.. Server or Local?

  

hi there,

I am confused with this instruction, either to put Static Entity 'SyncStatus' in the server or local storage?


If it is in the server side, how come it can be used while offline?


regards,

A

Hi A.,

As you can see when you right-click the Local Storage icon, it's not possible to add a Static Entity to Local Storage:

Static Entities are therefore by definition Server Entities.

However, since the content of a Static Entity is, well, static, it is possible to use the Identifiers of Static Entity Records client-side, and therefore off-line.

hi Kilian,

I am still confused, as it is offline so we cannot access the server. Does this mean there is a copy of the static entity in the local?

regards,

A

Solution

Hi A.,

No, there's not. But the Identifiers of Static Entities are known at compile time, since they are Static, so when you use e.g. Entities.MyStaticEntity.Value1, the compiler replaces this by "1" if you use it in an Aggregate.

Note that you cannot query the Static Entity: only the Identifiers are available. If you need more data, e.g. the Label, you'll need to sync the Static Entity yourself like other, non-static, Entities.

Solution