Syncdata()

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
Forum rules
New release: CSPro 8.0
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Syncdata()

Post by josh »

Yes, you can add the unique id or each device using getdeviceid() and add that to the filename by modifying the logic that writes out the pff file in your menu program. Not that the device id is fairly long. It might look something like: 1f06127c-267c-43a6-9f2f-4d55d28e030c. If you configure each device with a different gmail account you can instead use getusername() which will give you the gmail account used to configure the device. This is a bit more user friendly but creating 50 gmail accounts might take a while.
Mutanen Lau
Posts: 22
Joined: November 8th, 2016, 10:48 am

Re: Syncdata()

Post by Mutanen Lau »

Thank Josh,
i always have a challenge because i want to learn, please bear with me. is there a way i can allow interviewers to modify only partial save cases without giving them chance to re-opened completed cases. i try to use "Lock=Modify" in pff file but that will lock all cases for modification either completed or partial save cases. is there a solution to that please.

Regards
Lau
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Syncdata()

Post by josh »

We don't have an option for that in the pff file. You could try doing something in logic. Check if it is not add mode using demode() and check if it is a partial case using ispartial().

Code: Select all

if demode() <> 1 and not ispartial() then
   errmsg("Modification not allowed");
   stop(0);
endif;
Mutanen Lau
Posts: 22
Joined: November 8th, 2016, 10:48 am

Re: Syncdata()

Post by Mutanen Lau »

thank you,
but another dilemma is where am i going to place the code.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Syncdata()

Post by josh »

You want it to be called before anything else when the questionnaire starts so you would put it in the level preproc. The level is the one that ends in "_QUEST". Make sure you use preproc otherwise it will happen at the end of the questionnaire after the data is entered.
Post Reply