PDA

View Full Version : How to undo offline edits to a list that cannot be synchronized


ABC123

cptutrecht
07-22-2017, 06:36 PM
Sometimes because of database constraints offline edits to a list cannot be synchronized.
What would be the best practice to remove specific unsynchronized edits to a list or child list? (without loosing edits to a list that can be synchronized)?

Any help is welcome

cptutrecht
07-27-2017, 05:14 AM
Many reads, no comments...
So it seems I should provide more information.

Setting: Parent List and some child lists are update through formviews and editors. Customers and contacts of customers for example
I would like to allow multiple edits before synchronizing the parent list with the server

One of the possibilities is deleting a record in the parent list. When synchronizing to the server a database constraint can forbid that because the customers have invoice records.
I see that than also the other edits to list are not synchronized to the server.

How can I than remove the delete action from the list, without losing other edits to the list?

I can of course synchronize each and every edit to the list as soon as it happens, but by that you loose the advantage of working disconnected and is far less efficient.

bea2701
07-28-2017, 10:46 AM
Many reads, no comments...
So it seems I should provide more information.

Setting: Parent List and some child lists are update through formviews and editors. Customers and contacts of customers for example
I would like to allow multiple edits before synchronizing the parent list with the server

One of the possibilities is deleting a record in the parent list. When synchronizing to the server a database constraint can forbid that because the customers have invoice records.
I see that than also the other edits to list are not synchronized to the server.

How can I than remove the delete action from the list, without losing other edits to the list?

I can of course synchronize each and every edit to the list as soon as it happens, but by that you loose the advantage of working disconnected and is far less efficient.

First ask Selwyn how data is stored on the [ offline] client by example only memory or client db (slave) like pouchdb perhaps websql or indexeddb then u know more

cptutrecht
07-28-2017, 11:34 AM
Perhaps good to know that I use the local storage option in the component (not working with Phonegap).

Ted Giles
07-29-2017, 02:54 AM
I don't use AA for Web stuff, strictly Alpha DeskTop, however in the aplication I use, Web and Mobile would have the same update constraints.
So, if you have a restriction under what conditions and when a field can be updated, I would add it to the mobile storage ( like sqlite or similar).
If restrictions are in place, they should probably be Global.

cptutrecht
07-29-2017, 07:34 AM
Thanks for your reply, you are right, of course the restrictions are Global.

But I estimate that our application / data is too big to store all data with possible contraints also on the mobile device (without performance issues). Anyway it would make implementing real disconnected operation a lot more complicated than intended by AA I guess.

The 'mobile' part of the application is only a subset of the webapplication (which doesn't need to be working disconnected), but it can encounter most of the constraints.
For CRU operations I don't see problems until now, javacript validation and working with the listcontrol editor can prevent problems. Maybe I should not implement Deletes (but it is a little bit silly not to allow a user deleting an entity which he just created (perhaps by mistake) on the mobile device.

Easy would be to be able, if a contraint prevents updating, to catch that at the client and take appropriate action (in this case just remove that specific edit from the list at the right time).

Peter.Greulich
07-29-2017, 12:08 PM
Perhaps good to know that I use the local storage option in the component (not working with Phonegap).

Local storage with PhoneGap does work. Suggest you build a very simple test case and try it.

BTW: Alpha lets you address SQL-Lite on the device which allows much greater storage than local storage.

Ted Giles
07-29-2017, 02:50 PM
You might also only allow data which CAN be managed to show on the Mobile Device.
Some records are cast in stone(ish) while on the road, while others - like appointments - are changeable.
If a user enters a data item on the mobile device but does so in error, you are stuffed as you don't know if it really is an error.

In the Health Care sector this problem is evident, so we have "sweeper" programmes to identify inconsistencies and get the user to sort it out when on line.

I admit to being of the opinion that only the most limited processing should go on with mobile devices. Mainly lookups.

cptutrecht
07-29-2017, 05:03 PM
Local storage with PhoneGap does work. Suggest you build a very simple test case and try it.

BTW: Alpha lets you address SQL-Lite on the device which allows much greater storage than local storage.

Hi Peter, sorry my post was ambiguos: I ment: I am not using Phonegap, so I use local storage (and not the filesystem).

Peter.Greulich
07-29-2017, 05:16 PM
Sorry Ger. I misunderstood.

Ted Giles
07-29-2017, 05:54 PM
Local storage? Interesting!
Sim, Device or SD Card.
You test for these?

cptutrecht
07-29-2017, 06:09 PM
Local storage? Interesting!
Sim, Device or SD Card.
You test for these?

It is new realm for me too. But I understood that local storage means the storage space in the browsermemory itself.

Peter.Greulich
07-29-2017, 06:19 PM
But I understood that local storage means the storage space in the browsermemory itself.

That's how I understand it as well.

WebDesignShop
04-06-2018, 11:27 AM
You can programmatically remove individual flags. You can also programmatically do sync and step through records individually. You can also direct the user to only sync one parent at a time, which would sync sub records along with it.

bea2701
04-06-2018, 12:13 PM
You can programmatically remove individual flags. You can also programmatically do sync and step through records individually. You can also direct the user to only sync one parent at a time, which would sync sub records along with it.

or combine is by example on a sqlserver as master and use sqllitw remote then Sync AA ca handle that