syncdata with an optional parameter CLEAR

What would you like to see in CSPro?
Forum rules
New release: CSPro 8.0
Post Reply
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

syncdata with an optional parameter CLEAR

Post by AriSilva »

I have an application that uses the server to download control files for the interviewers.
These control files need some updating from the supervisors, and the problem we are facing is that the sycdata with a put parameter is duplicating the records n the server.
I thought about having an optional parameter like
syncdata(put, dict, universe, clear);
to clear the data in the server before uploading.
Or do you have an alternative solution?
Best
Ari
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: syncdata with an optional parameter CLEAR

Post by Gregory Martin »

We will keep your suggestion in mind. An idea I have had is to allow the definition of a user-defined function like OnSyncConflict that you can add to your logic to help resolve sync conflicts. (I don't work on any of the sync code though.)
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: syncdata with an optional parameter CLEAR

Post by josh »

Sync will only create duplicates if you are creating new cases on multiple devices i.e. user 1 creates a case on her tablet and then user 2 creates another case with the same case id on his tablet. If you create the cases for the control file ahead of time, download them to the tablets and then have the user modify the cases instead of creating new ones you won't have any duplicates.

Other strategies that people use to avoid duplicates are to limit which users are allowed to create cases with certain ids through an assignments lookup file. User 1 is assigned area 1 and can only create cases with ids in that area, user 2 can only create cases in area 2... Alternatively, add an additional ID variable to each case which is specific to the user (like a user code) which makes it easier to figure out how to handle the duplicates.
Post Reply