2

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).

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.

  • 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. – Joe McLaughlin Jun 7 '16 at 5:36
  • I've created an issue here - drupal.org/node/2743841 – Joe McLaughlin Jun 7 '16 at 6:23
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.

  • 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). – Joe McLaughlin Jun 7 '16 at 15:28
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

  • 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. – nielo May 24 '18 at 12:18
  • 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. – SRQ_civicrm May 24 '18 at 21:20
  • Hi thanks @HikerBoricua I have not looked into this at all since I posted it about 2 years ago :( thanks for reviving it :) . – Joe McLaughlin May 24 '18 at 22:02

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.