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) »
  • Deleting case types
Pages: [1] 2

Author Topic: Deleting case types  (Read 5468 times)

anothername

  • I post occasionally
  • **
  • Posts: 64
  • Karma: 3
  • CiviCRM version: CiviCRM 4.2.6
  • CMS version: Drupal 7.19
  • MySQL version: 5.1.66-0+squeeze1-log
  • PHP version: 5.3.3-7+squeeze14
Deleting case types
June 13, 2011, 09:26:41 am
Does anyone know a way to delete case types? So far, the only thing I could figure out is to disable them -- which doesn't cause them to be removed from the list of possible cases to use when opening up a new case.

Thanks!

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: Deleting case types
June 13, 2011, 09:47:12 am
If you have existing cases in the system with that case type, it probably won't let you delete it.

But disabling probably should remove from the list of choices on new case (but not for e.g. search). As a workaround you could implement the buildform hook and remove it from the choices.

anothername

  • I post occasionally
  • **
  • Posts: 64
  • Karma: 3
  • CiviCRM version: CiviCRM 4.2.6
  • CMS version: Drupal 7.19
  • MySQL version: 5.1.66-0+squeeze1-log
  • PHP version: 5.3.3-7+squeeze14
Re: Deleting case types
June 13, 2011, 03:01:20 pm
Ok, that makes sense.

But there are some case types that do not have any cases made -- and even those cannot be deleted. That is, in the admin console the only choices are "disable" and "edit" even though at the top of the edit cases page it says: "Edit or delete cases."   

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: Deleting case types
June 14, 2011, 02:33:50 pm
What version are you using? (Can you update your forum profile?)

anothername

  • I post occasionally
  • **
  • Posts: 64
  • Karma: 3
  • CiviCRM version: CiviCRM 4.2.6
  • CMS version: Drupal 7.19
  • MySQL version: 5.1.66-0+squeeze1-log
  • PHP version: 5.3.3-7+squeeze14
Re: Deleting case types
July 21, 2011, 09:38:35 am
Updated. Civi 3.44. Drupal 6.2.2

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Deleting case types
July 21, 2011, 03:48:27 pm
I suspect the problem is that you HAD one or more cases using those case type(s) - and you "deleted" them. HOWEVER, CiviCase does not actually allow true delete - deleted cases are still present in the DB and marked as "deleted" in the database. (This was an audit requirement of the original sponsor / designer of the component).

The Case Types admin screen still "sees" those deleted case types and therefore won't let you delete the associated type. A work around is:

* Find those 'deleted' cases from Find Cases -> check the Deleted Cases box.
* Restore them temporarity and change their Case Type to one u want to keep.
* "Delete" (move to trash) them again
Now you should be able to delete the case type.

Protect your investment in CiviCRM by  becoming a Member!

anothername

  • I post occasionally
  • **
  • Posts: 64
  • Karma: 3
  • CiviCRM version: CiviCRM 4.2.6
  • CMS version: Drupal 7.19
  • MySQL version: 5.1.66-0+squeeze1-log
  • PHP version: 5.3.3-7+squeeze14
Re: Deleting case types
August 11, 2011, 03:24:22 pm
Ok, I did this and it still doesn't allow me to delete case types.

The only options are: "Edit" "Disable"

I restored all cases with the unwanted case type and reassigned them to another case type and the deleted them again. (I don't know if that last step is necessary.)

Any other ideas? Other folks must have this problem?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Deleting case types
August 11, 2011, 03:35:12 pm
If you can replicate your condition on the public demo, and provide steps to get there - then file a bug report. Or you can try a instrument some debug logic in the code to see why the Delete action is suppressed.

The code which handles this is in CRM/Core/OptionValue.php getRows()
See line 116 where CRM_Case_BAO_Case::getUsedCaseType( ) is called to figure out whether any cases use a given case type.
Protect your investment in CiviCRM by  becoming a Member!

anothername

  • I post occasionally
  • **
  • Posts: 64
  • Karma: 3
  • CiviCRM version: CiviCRM 4.2.6
  • CMS version: Drupal 7.19
  • MySQL version: 5.1.66-0+squeeze1-log
  • PHP version: 5.3.3-7+squeeze14
Re: Deleting case types
August 12, 2011, 11:02:11 am
How can I upload .xml files to the test server?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Deleting case types
August 12, 2011, 11:46:14 am
You can't - so if the problem doesn't recreate there with the sample xml you'll need to debug on your server. Jump on IRC if you need help.
Protect your investment in CiviCRM by  becoming a Member!

anothername

  • I post occasionally
  • **
  • Posts: 64
  • Karma: 3
  • CiviCRM version: CiviCRM 4.2.6
  • CMS version: Drupal 7.19
  • MySQL version: 5.1.66-0+squeeze1-log
  • PHP version: 5.3.3-7+squeeze14
Re: Deleting case types
August 12, 2011, 12:33:31 pm
I guess I am a bit confused.

How can I recreate the problem on the demo site using the only two existing case types which are un-deletable anyway? I need to create a new case type, add cases to it (thus the need for .xml standard timeline), change those case types to different ones, and then delete the case type I created.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Deleting case types
August 12, 2011, 03:05:10 pm
Not sure we're communicating well here :-(

I just went through the exercise on the demo site and it works as advertised. I changed the Case Type for the one case whose type was Adult Daycare Referral to the other available case type (Housing Support). I was then able to delete the Adult Daycare case type since there were no longer any cases using that type.

If it doesn't work that way on your site, something else is going on that you'll need to debug.
Protect your investment in CiviCRM by  becoming a Member!

anothername

  • I post occasionally
  • **
  • Posts: 64
  • Karma: 3
  • CiviCRM version: CiviCRM 4.2.6
  • CMS version: Drupal 7.19
  • MySQL version: 5.1.66-0+squeeze1-log
  • PHP version: 5.3.3-7+squeeze14
Re: Deleting case types
August 15, 2011, 01:44:12 pm
Ok. I did the same. Created a case > deleted the case > changed its case type > deleted its previous case type...

This cannot be done in my civi install. One funny thing is that the 'delete' button has never existed under the case type options, only 'delete' and 'disable.' It never appeared even when first creating a new case type...

Any reason for this?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Deleting case types
August 15, 2011, 04:40:37 pm
Sorry, not following you ("delete button doesn't exist, only delete and disable") - but in any case you'll need to debug locally using the reference above. I'm out of ideas.
Protect your investment in CiviCRM by  becoming a Member!

anothername

  • I post occasionally
  • **
  • Posts: 64
  • Karma: 3
  • CiviCRM version: CiviCRM 4.2.6
  • CMS version: Drupal 7.19
  • MySQL version: 5.1.66-0+squeeze1-log
  • PHP version: 5.3.3-7+squeeze14
Re: Deleting case types
August 16, 2011, 11:24:07 am
Sorry, that was a typo. The only options for existing case types (regardless of if they have cases assigned to them) are 'disable' and 'edit.' There is not 'delete' option even for those case types which do not have cases.

Thanks anyway!

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

This forum was archived on 2017-11-26.