0

I'm just curious if anyone has done work with CiviCRM Entity and activities. I was considering whether it makes sense (or is even possible) to have people edit certain activities from Drupal rather than from CiviCRM.

We have a lot of custom activity types with a lot of custom data (total about 600 fields) - it is only appropriate to view/add/edit the custom data related to the appropriate activity type.

  • For viewing activity info, I found that I could use either the Module View Mode Page or create a view with some contextual filters and a rendered entity that uses a custom view mode (or simply a customized view).
  • For editing an activity - is there any way to limit what is on the form? Rather than showing the long list of all activity custom data?
  • Depending on the answer to the question directly above, how can I avoid loading all 600 fields?

(Drupal 7.78, CiviCRM Entity 7.x-2.2, CiviCRM 5.33.4)

2
  • I may be off-topic. Have you already set certain custom fields to only show on certain Activity Types? Have you considered using Webforms where you can add the exact fields you want on the form (and get to it from a View with the Activity and Activity Contacts in the url)?
    – petednz - fuzion
    Apr 5, 2021 at 18:52
  • Oh yes, on the civi side the custom field sets are set to only show on the appropriate activities. I hadn't thought about that - these are case activities but I'd think that's still surmountable. @petednz-fuzion The webform would show any values already filled in based on the aid in the URL - is that correct?
    – RayWright
    Apr 5, 2021 at 19:09

1 Answer 1

1

With CiviCRM Entity, there is a Drupal form for editing activities /civicrm-activity/[activity-id]/edit

Unfortunately the form does not limit to only those custom fields that are appropriate for the activity type.

In the past, we had done hook_form_alter() implementation in custom module to hide custom fields depending on activity type. This feature to only show custom fields appropriate for activity type is on our radar for future improvements.

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.