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) »
  • Deleted Cases Included in Advanced Search Results
Pages: [1]

Author Topic: Deleted Cases Included in Advanced Search Results  (Read 698 times)

PrincessAng417

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 2
  • CiviCRM version: 4.5.4
  • CMS version: Drupal 7.34
Deleted Cases Included in Advanced Search Results
August 26, 2014, 09:45:31 am
I am attempting to perform an Advanced search on Cases.

I am in Advanced Search; I am displaying the output as Cases, and I have a date filtered for this month's cases.

I am coming up with a total of 16 Cases, but 2 of those are Deleted.  If I re-execute the search with the "Deleted" box checked, indeed, the 2 Deleted cases are returned.

Is there a way to search and EXCLUDE the Deleted cases? 

Is there a way to automatically change a Case's status to Deleted (instead of Ongoing, etc.) upon deletion, so that it may be excluded by the user executing the search?

From what I'm reading on the forums, it looks like the only way to delete these Cases for certainty is to go through the database?  I can do that... but is there a way to set a Scheduled Job to do that?

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: Deleted Cases Included in Advanced Search Results
August 26, 2014, 01:39:19 pm
That sounds like either a bug or a documentation issue in advanced search. It might be doing the query on the underlying CONTACT, which is probably not deleted, and then when you choose display as case it still only cares about the CONTACT status.

I'm not sure what criteria you need that's in advanced search, but you might be able to get the results from either Find Cases or one of the CiviReports, which does handle deleted cases as expected.

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: Deleted Cases Included in Advanced Search Results
August 26, 2014, 03:31:02 pm
there have been some other discussions around this issue of how deleted cases are recorded eg
http://forum.civicrm.org/index.php/topic,31444.msg135792.html#msg135792
http://forum.civicrm.org/index.php/topic,32087.msg137276.html#msg137276
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

PrincessAng417

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 2
  • CiviCRM version: 4.5.4
  • CMS version: Drupal 7.34
Re: Deleted Cases Included in Advanced Search Results
August 26, 2014, 10:12:44 pm
Thanks for the responses.

I did see the first post, but not the second, that you supplied above.

So... what do we need to do here, and how can I help? I can help if it's a documentation issue (probably), but (probably not) if it's a bug.  What further querying can I do through the UI to help determine the nature of what's happening?

(And I do want to help; I have gotten so much help out of the forums through our deployment process-- I want to give back where I can.)

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Deleted Cases Included in Advanced Search Results
August 27, 2014, 03:36:46 am
Quote from: PrincessAng417 on August 26, 2014, 10:12:44 pm
(And I do want to help; I have gotten so much help out of the forums through our deployment process-- I want to give back where I can.)
Hey there,
Helping out with documentation is welcome at any time - always great to have experienced users on the documentation team. If you have a bit of time to help with CiviCase documentation, please join this email list http://lists.civicrm.org/lists/info/civicrm-docs and keep an eye out on the blog for posts like this https://civicrm.org/blogs/jchester/join-45-documentation-dash.

Sorry for hijacking the thread - just wanted to let you know :)
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

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: Deleted Cases Included in Advanced Search Results
August 27, 2014, 07:06:24 am
Maybe if you can confirm that the same thing happens on the public demo, to rule out some other problem:
http://demo.civicrm.org/

And then since there are multiple issues in this thread I'd just like to clarify what we're talking about:

1)
(a) On advanced search, when you choose display as cases, is the query ignoring the deleted status of a case if the client contact otherwise satisfies the search criteria?
(b) If so, is this the desired/expected behaviour because advanced search is really a CONTACT search, so deleted is intended to apply to the contact. I can see arguments both ways.
  (i) If yes, then documentation should be updated to clarify that and the results screen should identify deleted cases as deleted.
  (ii) If no, then the search code should be updated to exclude deleted cases.

2) Should there be a way through the UI to empty the case trash and remove the entries completely from the database. Personally I think yes, but if so then it should be something that can be disabled outside the UI, because for certain legal-type applications you want to enforce the audit trail and not allow even admin users to turn that off.

3) (The second link in Pete's post above) When you delete a contact, their cases do not automatically get put in trash, and so some queries, like case dashboard, still end up including the cases. This is complicated by the fact that you can have multiple clients on a case, but in a single-client case it seems like those cases should automatically get put in trash.

PrincessAng417

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 2
  • CiviCRM version: 4.5.4
  • CMS version: Drupal 7.34
Re: Deleted Cases Included in Advanced Search Results
September 11, 2014, 12:21:06 pm
I have confirmed that it works the same way on the public demo.
  • a. Yes
    b. I say no.  If the Case is deleted, the Contact doesn't really meet the criteria of the search, and the Case nor the Contact should show up in the results.
  • I think so-- I think it should work just like the Contacts trash.
  • I agree that if there is only one Client on a Case, then the Case should be trashed (and ultimately be deleted).  At the *very* least, the Case Status should be changed to reflect that the Case is deleted, so the Cases can be separated from overall counts.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCase (Moderator: Dave Greenberg) »
  • Deleted Cases Included in Advanced Search Results

This forum was archived on 2017-11-26.