8

Deleting contacts causes problems because it removes their contribution records.

At the same time we don't want old contacts to show up unless they are explicitly requested (such as when searching for deleted contacts).

Is there any way to hide old contacts and exclude them from all queries? I know how to do this with advanced searches, but I don't want my basic user to have to deal with this.

Are there other ways to deal with old contacts and keep the database from becoming bloated?

I appreciate any help.

2
  • There are some good answers so far. Fleshing out the scenario might help people come up with advice. You could give some concrete examples of the searches you are doing, and what old contacts are in this instances, and why they are annoying, etc. Aug 30, 2016 at 20:08
  • 1
    +1 on this - there are a wide variety of circumstances in which having an "inactive" flag would be helpful, separate from "is_deceased" or "deleted" but acting similarly to one or the other. Especially for folks coming from Raiser's Edge, where "constituents" are your donors - but donor's spouses, bosses, etc. might be in your database, but you don't want to explicitly track them. There are plenty of scenarios, and gnarly smart-group approaches aren't a great solution! Sep 7, 2016 at 16:06

5 Answers 5

6

CiviCRM has a "trash" feature which flags contact records as trash without actually deleting them. Contacts with the flag set to 1 are excluded from most reports, etc.

Their contributions, etc., will not be deleted but may be hidden from reports and interfaces as well. That may or may not be what you want. If you wish to see all the contributions, I don't think there is anything you can do without writing code to deal with most interfaces, but a lot of the reports have a filter to show/hide contributions from trashed contacts.

You can toggle this feature under Administer > System Settings > Misc, and there's a CMS-level permission "CiviCRM: access deleted contacts" that controls which users can see trashed contacts.

All said, I'm not sure that deleting or trashing contacts is the appropriate solution. It seems rather drastic to delete contacts for the purposes of returning manageable result sets. A better solution might be to hire a CiviCRM partner to build a custom search interface that better suits your needs. Or, a low-cost approach that occurs to me is to use your advanced-search know-how to build a Smart Group of current contacts as defined by you, then train collaborators to run their searches within this group.

1
  • Seconded for the last paragraph! Aug 23, 2016 at 19:51
3

You could create a custom field for all contacts called "Status" with options of Active and Archived. That will give you the selection you need in most places to easily include / exclude the appropriate contacts, especially on many reports and Advanced Searches. Then create two smart groups - Active and Archived - which include the appropriate contacts, and that will make the selection easier in most other places. Depending on the size of the database, how often you are rebuilding the smart group cache, and your host, you could take a hit on performance, so you have to use your judgement there.

This isn't transparent to users, but at least it's easily understood and it's simple - if they are Archived, check the field on the contact record. This gives you the flexibility of including the Archived contacts' contributions, event attendances, etc, when you want to compare numbers across years, but excluding them easily when creating current communications, etc.

The other thing I like about this is that it makes keeping the database up to date everyone's responsibility in real time on a going forward basis. There are going to be even basic users who learn of a contact that leaves an organization, or moves away, etc. This gives them the ability (and hopefully the responsibility) to mark that contact as Archived in the database as soon as they get the information, instead of waiting to tell someone, or for it to be caught the next time six months from now when someone goes through the database to find the Archived contacts.

3

I have an extension called Constituents Only that provides this functionality. It repurposes the "Do Not Trade" checkbox as an "Exclude from Search" checkbox. Non-searchable contacts are primarily accessible via the relationships tab to other contacts.

I have a version 2.0 (which I haven't found time to make public yet) that will return the related contact when searching - that is, if "Jane Doe" is searchable and her spouse "John Doe" is not, searching for "John" will return Jane Doe (John Doe). It also adds a checkbox to Advanced Search to search unsearchable contacts. However, this isn't quite what you're asking for, and version 1.0 is. I hope to release a new version at some point which toggles the behavior between the 1.0 and 2.0 versions, but incorporates newer features like the "search unsearchable contacts" checkbox.

2
  • Did v2 ever progress to a shareable concept Jon?
    – petednz - fuzion
    May 28, 2019 at 5:23
  • LOL just found my way back to this post again. Guess I should just take v1 for a run :-)
    – petednz - fuzion
    Jul 17, 2019 at 21:18
1

Here's a kind of wacky idea that might work for you: modify the contact type field in the civicrm_contact table to allow a new 'Archived' value in the enum list. Then run an occasional cron that converts Individual contact types to Archived contact types if they're "old" by whatever criteria you have. CiviCRM will ignore these contact records pretty much in every normal search/report. Or it might break something ... best to try this out on a test copy first. You'll still be able to access information in these records, using views, for example, if you're using Drupal.

0

Or you can also create a Report filtered on not-old contacts (as a Smart Group, for instance)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.