Delete Case in Csentry Android

Discussions about creating CAPI applications to run on Android devices
Forum rules
New release: CSPro 8.0
Post Reply
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Delete Case in Csentry Android

Post 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.
G.VOLNY, a CSProuser from Haiti, since 2004
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Delete Case in Csentry Android

Post 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.
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Delete Case in Csentry Android

Post 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,
G.VOLNY, a CSProuser from Haiti, since 2004
Post Reply