Answers.Body: <p>With CiviCRM Entity, there is a Drupal form for editing activities
  /civicrm-activity/[activity-id]/edit</p>
  <p>Unfortunately the form does not limit to only those custom fields that are appropriate for the activity type.</p>
  <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-04-05T19:05:23.410Z
Answers.LastActivityDate: 2021-04-05T19:05:23.410Z
Answers.UserDisplayName: jackrabbithanna
Body: <p>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.</p>
  <p>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.</p>
  <ul>
  <li>For viewing activity info, I found that I could use either the Module <a href="https://www.drupal.org/project/view_mode_page" rel="nofollow noreferrer">View Mode Page</a> or create a view with some contextual filters and a rendered entity that uses a custom view mode (or simply a customized view).</li>
  <li>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?</li>
  <li>Depending on the answer to the question directly above, how can I avoid loading all 600 fields?</li>
  </ul>
  <p>(Drupal 7.78, CiviCRM Entity 7.x-2.2, CiviCRM 5.33.4)</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-04-05T18:52:41.080Z
Comments.Text: 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)?
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-04-05T19:09:04.127Z
Comments.Text: 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?
Comments.UserDisplayName: RayWright
Tags: <activities><civicrm-entity>
Title: CiviCRM Entity and editing or viewing activites
ThreadText: # CiviCRM Entity and editing or viewing activites
  
  (Asked by: username_0 on 2021-04-05)
  
  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](https://www.drupal.org/project/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)
  
  **Tags:** activities, civicrm-entity
  
  > **Comments:**
  > **username_1**: 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)?  
  > **username_0**: 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. @username_1 The webform would show any values already filled in based on the aid in the URL - is that correct?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2021-04-05. Score: 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.
  
  
  ---
  
  