2

Drupal 7.39 CiviCRM (in this case 4.6.7)

We can't find any way to search for activities with attachments.

Am I missing something obvious?

Similar to this question: Search contacts with attachments

  • Do you want to mention your CMS in case a solution outside civicrm would be possible – petednz - fuzion Sep 17 '15 at 21:33
  • Sorry, bad form on my part. Added above. – pmoz Sep 17 '15 at 22:18
  • can't see any code for this for Drupal Views anyhow but would be one option to consider if you have some development skills to apply, but that said, would be more useful to have this directly in civicrm. not being much help sorry – petednz - fuzion Sep 17 '15 at 23:47
  • I am working on some code for views, but couldn't find any reference to attachments in and civi search functions. – pmoz Sep 18 '15 at 0:19
  • not sure if it helps you but i do know that Views can pull the civi contact image in but no idea if that assists with other files coming in to views – petednz - fuzion Sep 18 '15 at 2:32
1

This might be an answer to a slightly different question, but... in the past, I've used a mix of add-ons to perform a full-text search on activities and their attachments:

https://github.com/civicrm/apachesolr_civiAttachments

When you run a search with "Search => Full Text" and filter on activities, it will include any matches in PDFs/DOCs/etc that are attached to activities.

That module may be a significant undertaking (e.g. it requires an extra server, Solr, and the documentation is pretty rudimentary), but if you really need it, it might be a piece in the puzzle.

1

I've customized the Activity Report to display which activities have attachments. I don't think I added a filter to show ONLY records with attachments, but that's just another line or two of code. I've uploaded a copy to github here: https://github.com/PalanteJon/activityAttachmentReport/tree/master

Note that these aren't the only customizations I've made in this report, but you can search for "attachments" in my code to see how I added attachments to the report.

  • Thanks for sharing! I extracted the file-specific bits from your report and also added a filter option: gist.github.com/mlutfy/9971f0e2501ef1a0778b5b921965c34c – bgm Sep 7 '17 at 15:59
  • @bgm - this technique of customizing built-in reports by extending the class is pretty great! It seems obvious now that I see it, but I'd never thought of it before. – Jon G - Megaphone Tech Sep 7 '17 at 16:26
0

In the long run we found it easier to add custom attachment fields to Activities.

These are easier to work with in Views and are searchable in the Search Builder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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