Mobile Line Of Business

Richard Jones (MVP)

  Home  |   Contact  |   Syndication    |   Login
  202 Posts | 0 Stories | 36 Comments | 0 Trackbacks


Welcome to the Mobile Line Of Business Blog

Tag Cloud


Post Categories


So the adventure continues. I've been building an iPad app that consumes data from Dynamics NAV. I use NAV pages which I bring down into iOS via oData, these are then saved into a Core Data database. I only bring back records that have been altered since the date/time of the last sync. minimising data volumes. I've written a few custom classes that marshall the oData JSON formatted data correctly into Core Data attributes (i.e date/time and numeric/boolean conversion). In addition I introspect indexes on Core Data entities to work out if I'm doing an insert/update or delete. Once this synchronisation has taken place our user is then free to work offline. I then track in iOS records have been modified, using two simple flags [New_Record] and [Synchronised]. Slightly reverse logic for Synchronised (or maybe a bad name), but this flag is set to indicate that a record need to be sent back to NAV. When the sync. process runs again it pushes back to NAV any changes. This process works very well, its lightweight and built entirely in SWIFT. Everything works without any complex session state handling. It doesn't do anything really smart like conflict resolution which you get with technologies like SQL merge replication. However for my purposes it works just fine. I've even got it to the stage where I can handle media (video, audio, images) using Hex Encoding. Finally... We have a fail safe. I have the option of emailing off of the device CSV's containing records that need to be sent back to the server. Just in case...
posted on Saturday, January 10, 2015 1:09 PM