Answers.Body: <p>Try exposing the "activity type" field as "user select". On the webform, change that field to a checkbox with just the one activity type as an available option. That allows the user to toggle activity creation on and off. Also for better UX set a conditional rule for the other activity fields to be shown/hidden based on that checkbox.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-07T15:28:54.833Z
Answers.Text: Thanks Coleman I'll revise the issue on Drupal just to address the notice issue - i.e.:  Notice: Undefined index: act in wf_crm_webform_postprocess->processActivities() (line 1368 of /var/www/citizenactionny/my.citizenactionny.org/sites/all/modules/webform_civicrm/includes/wf_crm_webform_postprocess.inc).
Answers.UserDisplayName: Joe McLaughlin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-07T15:05:17.153Z
Answers.LastActivityDate: 2016-06-07T15:05:17.153Z
Answers.UserDisplayName: Coleman
Answers.Body: <p>If you use a webform condition (part of Drupal webform 4.x), with a question like 'Did you speak with the target?', you could hide the fields for Activities 2 and 3 if the caller enters 'No'. If the fields are hidden based on the condition, they will not process to CiviCRM.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-07T05:36:11.823Z
Answers.Text: OK so even though the fields for Activity 2 and Activity 3 are hidden ("isn't  shown") if phone call equals various results, Activity 2 and Activity 3 are still being recorded with a status of Completed.
Answers.UserDisplayName: Joe McLaughlin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-07T06:23:47.210Z
Answers.Text: I've created an issue here - https://www.drupal.org/node/2743841
Answers.UserDisplayName: Joe McLaughlin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-07T04:50:41.537Z
Answers.LastActivityDate: 2016-06-07T04:50:41.537Z
Answers.UserDisplayName: Allen Hutchison
Answers.Body: <p>I am also getting "Notice: Undefined index: act in wf_crm_webform_postprocess->processActivities()" but perhaps two years on it's moved to line 1411 (webform_civicrm 7.x-4.20).  The line relates to sending an email to the activity's assignee, specifically to sending attachments (none in my case).  I worked around it with the "@" php error control operator, see snippet below.</p>
  
  <p><a href="https://i.sstatic.net/zAjdw.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/zAjdw.png" alt="code snippet"></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-24T12:18:19.270Z
Answers.Text: Could you clarify what your point is? Are you answering "To fix this just suppress php's error messages" or are you complaining about the error not being fixed? If the former, I think it's a bad idea, if the latter and this can be reproduced in demo, you should IMHO open an issue or a new question and reference this.
Answers.UserDisplayName: nielo
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-24T21:20:24.413Z
Answers.Text: Joe McLaughlin already has an active Drupal issue re. the php notice. I added a comment to that to make sure the developers know it still matters. Re. the error suppression, I'm not proud just desperate. I couldn't show that notice to our volunteers, and everything I need work OK. If I were a CiviCRM developer I could come up with a real solution, but my sketchy php likely would make things worse not better. Bottom line, my point is to let the next lowly implementer out there desperately facing this know that there's a work around.
Answers.UserDisplayName: wil_SRQ
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-24T22:02:22.270Z
Answers.Text: Hi thanks @HikerBoricua I have not looked into this at all since I posted it about 2 years ago :( thanks for reviving it :) .
Answers.UserDisplayName: Joe McLaughlin
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-24T10:04:32.857Z
Answers.LastActivityDate: 2018-05-24T10:04:32.857Z
Answers.UserDisplayName: wil_SRQ
Body: <p>We're on Civi 4.6.17 and Drupal 7. </p>
  
  <p>I've created a webform with a 'script' for callers with multiple Activities. Activity 1 is to record the results of a phone call asking for an in-person meeting (call is Completed, Left Message, etc) with the 'target' contact. Activity 2 is to record the date, time, subject, status  of a successful request for an in-person meeting made on the phone call. Activity 3 is to create a reminder to the caller to send a reminder of the in-person meeting to the 'target' contact by postal mail, e-mail or text messsage.</p>
  
  <p>When callers can (or cannot) reach the target on the phone, then Activity 1 date, time, subject, status is recorded. If the target cannot be reached, the call ends of course. However, even though a date, time, status are not recorded for Activity 2 and Activity 3, both activities are entered as completed in the caller's Activity record, and an e-mail gets sent to the caller (who is Assigned To: the activity) </p>
  
  <p>I have a default subject for Activity 2 and Activity 3. I'll try removing the default subject text, leaving it blank, and see if that is the cause of Activity 2 and Activity 3 being recorded.  </p>
  
  <p>My desired outcome is simply for Activity 1 status to be saved and Activity 2 and Activity 3 to not be saved on form submittal if the caller does not talk with the 'target'.</p>
  
  <p>I'm also getting this error message on form submittal which seems to be related:
  Notice: Undefined index: act in wf_crm_webform_postprocess->processActivities() (line 1368 of /var/www/citizenactionny/my.citizenactionny.org/sites/all/modules/webform_civicrm/includes/wf_crm_webform_postprocess.inc).</p>
  
Tags: <webform-civicrm><activities>
Title: Why do Activities entered via a webform *not* marked as Completed get entered into Civi as completed?
ThreadText: # Why do Activities entered via a webform *not* marked as Completed get entered into Civi as completed?
  
  (Asked by: username_0 on 2016-06-07)
  
  We're on Civi 4.6.17 and Drupal 7.
  
  I've created a webform with a 'script' for callers with multiple Activities. Activity 1 is to record the results of a phone call asking for an in-person meeting (call is Completed, Left Message, etc) with the 'target' contact. Activity 2 is to record the date, time, subject, status of a successful request for an in-person meeting made on the phone call. Activity 3 is to create a reminder to the caller to send a reminder of the in-person meeting to the 'target' contact by postal mail, e-mail or text messsage.
  
  When callers can (or cannot) reach the target on the phone, then Activity 1 date, time, subject, status is recorded. If the target cannot be reached, the call ends of course. However, even though a date, time, status are not recorded for Activity 2 and Activity 3, both activities are entered as completed in the caller's Activity record, and an e-mail gets sent to the caller (who is Assigned To: the activity)
  
  I have a default subject for Activity 2 and Activity 3. I'll try removing the default subject text, leaving it blank, and see if that is the cause of Activity 2 and Activity 3 being recorded.
  
  My desired outcome is simply for Activity 1 status to be saved and Activity 2 and Activity 3 to not be saved on form submittal if the caller does not talk with the 'target'.
  
  I'm also getting this error message on form submittal which seems to be related:
  Notice: Undefined index: act in wf\_crm\_webform\_postprocess->processActivities() (line 1368 of /var/www/citizenactionny/my.citizenactionny.org/sites/all/modules/webform\_civicrm/includes/wf\_crm\_webform\_postprocess.inc).
  
  **Tags:** webform-civicrm, activities
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2016-06-07. Score: 1
  
  Try exposing the "activity type" field as "user select". On the webform, change that field to a checkbox with just the one activity type as an available option. That allows the user to toggle activity creation on and off. Also for better UX set a conditional rule for the other activity fields to be shown/hidden based on that checkbox.
  
  > **Comments:**
  > **username_0**: Thanks username_1 I'll revise the issue on Drupal just to address the notice issue - i.e.:  Notice: Undefined index: act in wf_crm_webform_postprocess->processActivities() (line 1368 of /var/www/citizenactionny/my.citizenactionny.org/sites/all/modules/webform_civicrm/includes/wf_crm_webform_postprocess.inc).  
  
  ---
  
  ### Answer by username_2 on 2016-06-07. Score: 1
  
  If you use a webform condition (part of Drupal webform 4.x), with a question like 'Did you speak with the target?', you could hide the fields for Activities 2 and 3 if the caller enters 'No'. If the fields are hidden based on the condition, they will not process to CiviCRM.
  
  > **Comments:**
  > **username_0**: OK so even though the fields for Activity 2 and Activity 3 are hidden ("isn't  shown") if phone call equals various results, Activity 2 and Activity 3 are still being recorded with a status of Completed.  
  > **username_0**: I've created an issue here - https://www.drupal.org/node/2743841  
  
  ---
  
  ### Answer by username_3 on 2018-05-24. Score: 0
  
  I am also getting "Notice: Undefined index: act in wf\_crm\_webform\_postprocess->processActivities()" but perhaps two years on it's moved to line 1411 (webform\_civicrm 7.x-4.20). The line relates to sending an email to the activity's assignee, specifically to sending attachments (none in my case). I worked around it with the "@" php error control operator, see snippet below.
  
  [![code snippet](https://i.sstatic.net/zAjdw.png)](https://i.sstatic.net/zAjdw.png)
  
  > **Comments:**
  > **username_4**: Could you clarify what your point is? Are you answering "To fix this just suppress php's error messages" or are you complaining about the error not being fixed? If the former, I think it's a bad idea, if the latter and this can be reproduced in demo, you should IMHO open an issue or a new question and reference this.  
  > **username_3**: username_0 already has an active Drupal issue re. the php notice. I added a comment to that to make sure the developers know it still matters. Re. the error suppression, I'm not proud just desperate. I couldn't show that notice to our volunteers, and everything I need work OK. If I were a CiviCRM developer I could come up with a real solution, but my sketchy php likely would make things worse not better. Bottom line, my point is to let the next lowly implementer out there desperately facing this know that there's a work around.  
  > **username_0**: Hi thanks @HikerBoricua I have not looked into this at all since I posted it about 2 years ago :( thanks for reviving it :) .  
  
  ---
  
  