Is it possible and what's the best way to add case fields (e.g. case type) to an activity report whilst still ensuring civi can be updated easily?

I'd imagine those aren't default options because not all activities are related to a case.

  • 1
    Maybe if you can describe what you'd like the final report to look like? It's not quite clear what you're asking.
    – Demerit
    Commented Aug 10, 2016 at 4:32
  • @Demerit I'm not sure what else I can add to clarify. Basically, for those activities that are related to a case, I want case fields like case type and start date or whatever listed alongside that activity in the activity report.
    – inteja
    Commented Aug 10, 2016 at 22:26

1 Answer 1


Search - Custom Searches - Activity Search supports case id at least already, but the display template explicitly doesn't show it, although it uses it to create links.

Doesn't look like it would be difficult to modify Activity Search. You might also be able to modify the Activity CiviReport similarly. For Activity Search, it would be something like:

1) In CRM/Contact/Form/Search/Custom/ActivitySearch.php:
(a) Near the top where it defines the columns, add your columns labels as desired.
(b) In function all(), add the case-related fields to the select definition.
(c) In function from(), add a left join on civicrm_case.

2) In templates/CRM/Contact/Form/Search/Custom/ActivitySearch.tpl, display your new columns as desired.

Your Answer

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

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