CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCase (Moderator: Dave Greenberg) »
  • Case deletion
Pages: [1]

Author Topic: Case deletion  (Read 1258 times)

irvken

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 1
Case deletion
January 27, 2014, 01:48:04 am
Should I be able to delete these cases  completely as I can with contacts?

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: Case deletion
January 27, 2014, 05:45:04 am
CiviCase works mostly under the assumption that information put in the system can never be deleted. For example, modifying custom data of the case will create a "change custom data" activity, or changing the case start date, status, etc, generates an activity to help track the changes done to a case.
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Case deletion
January 27, 2014, 12:53:53 pm
if we have a mistake made where a contact ends up with 2 cases instead of one, what is the best approach for deleting one of them?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: Case deletion
January 27, 2014, 02:37:32 pm
There's a merge cases link kind of hidden in the middle of the screen on manage case, on the left under the dropdowns. I think it only shows up if there are at least two open cases for the same contact.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Case deletion
February 02, 2014, 09:28:05 pm
So I see - thanks for pointing that out - but it leaves the 'deleted' case in the db - and hence is forcing us to tweak lots of forms etc to filter out 'is deleted'

I think I am still hoping that there is a 'delete permanently' option just as there is with civi contacts.

I am taking it this doesn't exist, and I should continue to work around this, find a sql query that will do the full clean out of case, relationships with the case ID, activities with the Case ID etc,

or suggest a patch that adds this option but presumably with an extra permission for it too. thoughts?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Case deletion
February 03, 2014, 12:41:53 am
I am afraid that is the case Pete  ;D
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: Case deletion
February 03, 2014, 06:14:35 am
For what it's worth, deleting with "delete from civicrm_case where is_deleted = 1;" should delete everything, since there are foreign key relations to the other tables (activities, relations) with the option "on delete cascade".
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Case deletion
February 18, 2014, 04:19:40 pm
Eileen reckons the above wont work as you would also need
Code: [Select]
DELETE c, ca, a FROM
civicrm_case c LEFT JOIN
civicrm_case_activity ca ON c.id = ca.case_id
LEFT JOIN civicrm_activity a ON ca.activity_id = c.id
WHERE case_id = 246;

but Eileen also reckons that via the api works

CRM.api('case', 'delete', {'id' : xxx});
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Case deletion
March 29, 2015, 03:55:59 pm
I posted a question on this topic to http://civicrm.stackexchange.com/questions/176/how-should-i-delete-a-civicase-or-a-case-type/177#177

please help improve it
« Last Edit: March 29, 2015, 03:59:10 pm by petednz »
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCase (Moderator: Dave Greenberg) »
  • Case deletion

This forum was archived on 2017-11-26.