[Migrated from the Syclo Resource Center]
ChristianBartels 05/04/2011 15:50,
Hi everyone,I'm running into the problem that data (objects) which have been created locally on the device and for which no pending transactions exist, are getting deleted when switching users or downloading an application update during a sync.Is there away to prevent this without temporarily storing the data in a backend system?
Thanks,Christian
admin 05/04/2011 17:00
Set the attribute Preserve Objects in the Module definition to true (check the box for this attribute). This will prevent the object instances from being removed from the Agentry Client on a user change.As for application changes, in a development environment, that is, when synchronizing with an Agentry Development Server, touching any definition within the module will force a full data reload for that module. This means all object instances are removed and must be retrieved again. There is no means of overriding this behavior. This means local objects not updated to the backend system will be removed.In a production environment (sync with an Agentry Production Server), the system is more discerning, typically only reloading object instances when definitions directly related to those objects are modified. For example, published changes to a screen set won't typically force objects to be reloaded on the client. However, sooner or later a change to the data definitions within the module is likely to occur and those objects will be removed. This is necessary as any change to the type of data stored by the object definition requires the internal storage structures to be adjusted accordingly. Such adjustments require the reload of that data to match to new structure.In general the objects, and really any data, stored by the Agentry Client should be considered temporary. Transactions certainly have several safeguards to prevent data loss in a number of different potential error scenarios, but object data typically resides in the back end system, or is updated to it by a transaction. Objects created on the client and not uploaded to the back end cannot be counted on to exist in perpetuity. The client device is not intended to be its sole permanent residence. Counting on data that exists only locally on the Agentry Client to be persistent for any duration beyond the next transmit is not a safe design.Hope this info helps,Jason MicklevitzTechnical Writer/Training SpecialistSyclo
ChristianBartels 05/04/2011 17:51
Jason,awesome how quick you guys reply with helpful answers! Thanks!
Regarding preserve client objects setting: I was looking for such a setting but unfortunately only in app settings. Thanks for pointing me to the right spot.
Regarding data loss on app update: We were experience the issue on an agentry server set up for production. I think we didn't do any changes in the object structure (but only on screens and rules). I've a few changes pending and I will test it out on another server.background of my question: In our app, we are using the approach like it seems to be used by Syclo products like Work Manager: Objects are created locally and on submit, a subaction is checking for objects which should be send to the backend system (SAP in our case), e.g. if the object has a certain status, and it creates transactions for those. So, between adding/editing an object and submitting, it can happen that the user does one or more syncs without sending a particular object. If during those syncs a new app version is loaded, it might delete unsend data.
Regards,Christian
april april 05/04/2011 19:07
Christian - You are correct that In Work Manager, we currently bundle any changes and create the transaction at transmit time. We are not filtering objects in any way though - if something changed in the workorder object, it gets sent up and transactions are always processed by Agentry before new definitions would be sent down to the client.What business logic do you have in your application that doesn't send some changes but does send others? Is there any way that you can always send changes at transmit time? Please provide more specifics.Dave
ChristianBartels 05/04/2011 20:56
Dave,it's an Inventory Manager project. We added the possibility to run a sync to update master data (Materials) without sending inventory counts (physical inventory documents). It's necessary as, at least at the moment, sometimes run into master data inconsistencies (missing materials, materials with incorrect manufacturer part ID, etc) which need to be fixed and updated on the client before the inventory document can be send to SAP.Regards,Christian
april april 05/05/2011 11:50
well then you will likely need to have some flag in your app telling you that this master data sync needs to be run and you can add it to the main transmit action as a conditional subaction step.