Skip some case while synchronizing from server

Discussions about creating CAPI applications to run on Android devices
Forum rules
New release: CSPro 8.0
Post Reply
Bhupender11
Posts: 63
Joined: May 15th, 2018, 1:18 am

Skip some case while synchronizing from server

Post by Bhupender11 »

Dear CSPro Team,
Is there is any logic by which we download some cases from Ftp server and skip rest of all.
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Skip some case while synchronizing from server

Post by Gregory Martin »

With FTP and Dropbox sync, your only option is to download all of the cases. CSWeb is the only sync option that allows you to use a universe. The other two options don't have intelligent servers running so it isn't possible to have a universe.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Skip some case while synchronizing from server

Post by josh »

You can use a universe when you call syncdata() with CSWeb, FTP or Dropbox. However, as Greg mentioned, only CSWeb is intelligent enough to do this efficiently. With FTP and Dropbox, all the data will be downloaded to a temporary file and then the cases that do not match the universe will be ignored and the ones that do match the universe will be saved to the data file. With CSWeb, the server only sends the cases that match the universe.
Bhupender11
Posts: 63
Joined: May 15th, 2018, 1:18 am

Re: Skip some case while synchronizing from server

Post by Bhupender11 »

Thanks,
But how can I add universe to this code.
My code is
function syncWithHeadquarters()

if syncconnect(Ftp,"FTP Address","Username","Password") = 1 then

syncdata(GET,DictionaryName);

syncdisconnect();


endif;
end;

I have given "password" and "Date" as a Unique id. And each user have unique password.I want to download only cases which matches the password. For eg.
Here is password "ABC123" and I want to download only cases which have password "ABC123" rest i want to skip then
what my code is for downloading the cases.

Thanks in advance.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Skip some case while synchronizing from server

Post by josh »

Universe is a string that matches the start of your case id. So if the id-items in your dictionary are Password followed by Date then you could use a value for password as the universe:

syncdata(GET, DictionaryName, "ABC123");

For this to work password must be the first id-item in your dictionary.
Bhupender11
Posts: 63
Joined: May 15th, 2018, 1:18 am

Re: Skip some case while synchronizing from server

Post by Bhupender11 »

Thanks it's working.
Post Reply