Page 1 of 1

Delete Case in Csentry Android

Posted: February 27th, 2019, 6:35 pm
by htuser
Dear Cspro Developer Team,
I would like to delete lot of empty cases in Csentry and avoid them to be synchronized. In my applications, a case is empty if case label ="";
So, i could use sqlquery in a menu: delete from cases where label="";
But, it require to modify foreign constraint with on delete cascade in Csdb...
Greg informed me months ago, a way to delete case under conditions. But, i don't know if can use it with non ID item values.

Right now, univers can't use advanced conditions for synchronisation. It's based only on ID items starting number... so i can't sync only cases where case.label="";

Please help me with.

Best regards,
Please forget previous message since the application had a lock deleted in pff.

Re: Delete Case in Csentry Android

Posted: March 1st, 2019, 8:41 am
by Gregory Martin
You can temporarily turn off the use of foreign keys:
PRAGMA foreign_keys = 0;
DELETE FROM cases WHERE label = "";
PRAGMA foreign_keys = 1;
However, I definitely don't suggest this. You really shouldn't be modifying the .csdb file using SQLite statements. I would analyze your application and come up with a system so that you're not adding cases that you don't want synced. Reworking your workflow, rather than editing the file with SQLite, is the best option.

Re: Delete Case in Csentry Android

Posted: March 1st, 2019, 4:48 pm
by htuser
Thank you Greg. I understand that the best way is to give us a ways to use a more advanced universe for sync. In the meantime, using disable and enable PRAGMA foreign_key is the best solution.
Best Regards,