Answers.Body: <p>If Communication Style is set to Formal -> is_default on:</p>
  
  <pre><code>civicrm/admin/options/communication_style?reset=1
  </code></pre>
  
  <p>Then that's what shows in the Contact record (see below); Are you saying that webform_civicrm removes this default for existing contacts; or that new contacts have their is_default set wrong? </p>
  
  <p><a href="https://i.sstatic.net/aSkS5.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/aSkS5.png" alt="enter image description here"></a></p>
  
  <p><strong>Added:</strong> I've confirmed that creating a New Contact with the API leaves the Communication Style 'blank'. However one would expect it should be setting it to the default value that is specified in the Administer settings.</p>
  
  <p>So it's an API issue - we could fix this in webform_civicrm - by explicitly passing on a value for Parameter Communication Style - but I think it should be fixed in CiviCRM Core itself.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-07T17:51:21.813Z
Answers.Text: Yes, is set to default. When webform creates a contact it doesn't set anything and the default doesn't get set either. So if you view a newly created contact by webform none of the radio buttons are selected. Webform doesn't remove it on an existing contact.
Answers.UserDisplayName: frTommy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-07T17:53:05.350Z
Answers.Text: Webform uses the API to create contacts; let me run a check
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-07T18:56:17.637Z
Answers.Text: Yeah sounds like fixing the actual issue would be better. So do I need to log an issue in Jira for the API issue to get fixed? Or will you since you might be better able to describe the issue with the API?
Answers.UserDisplayName: frTommy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-07T20:41:15.937Z
Answers.Text: Why don't you log the issue - and then I'll jump in to mark it verified.
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-07T20:48:17.653Z
Answers.Text: Let me know when you've had a chance to do that.
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-07T20:56:19.850Z
Answers.Text: https://issues.civicrm.org/jira/browse/CRM-21041
Answers.UserDisplayName: frTommy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-07T17:47:51.300Z
Answers.LastActivityDate: 2017-08-07T18:02:40.697Z
Answers.LastEditDate: 2017-08-07T18:02:40.697Z
Answers.UserDisplayName: KarinG - Semper IT
Answers.Body: <p>This looks like a bug in core. Either an incorrect blank is set as a parameter from API layer before calling lower down, or the lower level BAO is not setting default correctly. Fr Tommy, could you create an issue in JIRA on this, including link to here, then assign the issue to Josh and mark as PIQ. My guess is that it would cost about $125 - $250 to fix the bug and add a test to ensure the API works properly on this.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-09T22:36:25.493Z
Answers.Text: https://issues.civicrm.org/jira/browse/CRM-21041  an issue is already created
Answers.UserDisplayName: frTommy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-09T20:34:26.080Z
Answers.LastActivityDate: 2017-08-09T20:34:26.080Z
Answers.UserDisplayName: Joe Murray
Body: <p>I have a webform set up as a Contact page that creates a civi contact and activity and assigns it. I have a scheduled reminder send out a "Thanks for contacting us...we'll get back to you asap..." email after the activity is created. There's an issue where Webform doesn't allow the Communication Format to be set and we use that in how we format our Email Greeting. We have Formal communication preference set as default option in Civi but when Webform creates the contact for some reason that default doesn't get set and so when the contact record is viewed there's no communication format at all. </p>
  
  <p>What are the options to fix this? Can Webform be updated to be able to set the communication format?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-07T03:58:08.187Z
Comments.Text: What CiviCRM version are you using?
Comments.UserDisplayName: KarinG - Semper IT
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-07T04:03:50.453Z
Comments.Text: I'm running Civicrm 4.7.21
Comments.UserDisplayName: frTommy
Tags: <drupal><contacts><webform-civicrm>
Title: Webform (Contact Create API) doesn't set Communication Style
ThreadText: # Webform (Contact Create API) doesn't set Communication Style
  
  (Asked by: username_0 on 2017-08-07)
  
  I have a webform set up as a Contact page that creates a civi contact and activity and assigns it. I have a scheduled reminder send out a "Thanks for contacting us...we'll get back to you asap..." email after the activity is created. There's an issue where Webform doesn't allow the Communication Format to be set and we use that in how we format our Email Greeting. We have Formal communication preference set as default option in Civi but when Webform creates the contact for some reason that default doesn't get set and so when the contact record is viewed there's no communication format at all.
  
  What are the options to fix this? Can Webform be updated to be able to set the communication format?
  
  **Tags:** drupal, contacts, webform-civicrm
  
  > **Comments:**
  > **username_1**: What CiviCRM version are you using?  
  > **username_0**: I'm running Civicrm 4.7.21  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2017-08-07. Score: 1 | Accepted answer
  
  If Communication Style is set to Formal -> is_default on:
  civicrm/admin/options/communication_style?reset=1
  
  Then that's what shows in the Contact record (see below); Are you saying that webform_civicrm removes this default for existing contacts; or that new contacts have their is_default set wrong? 
  
  Added: I've confirmed that creating a New Contact with the API leaves the Communication Style 'blank'. However one would expect it should be setting it to the default value that is specified in the Administer settings.
  So it's an API issue - we could fix this in webform_civicrm - by explicitly passing on a value for Parameter Communication Style - but I think it should be fixed in CiviCRM Core itself.
  
  > **Comments:**
  > **username_0**: Yes, is set to default. When webform creates a contact it doesn't set anything and the default doesn't get set either. So if you view a newly created contact by webform none of the radio buttons are selected. Webform doesn't remove it on an existing contact.  
  > **username_1**: Webform uses the API to create contacts; let me run a check  
  > **username_0**: Yeah sounds like fixing the actual issue would be better. So do I need to log an issue in Jira for the API issue to get fixed? Or will you since you might be better able to describe the issue with the API?  
  > **username_1**: Why don't you log the issue - and then I'll jump in to mark it verified.  
  > **username_1**: Let me know when you've had a chance to do that.  
  > **username_0**: https://issues.civicrm.org/jira/browse/CRM-21041  
  
  ---
  
  ### Answer by username_2 on 2017-08-09. Score: 0
  
  This looks like a bug in core. Either an incorrect blank is set as a parameter from API layer before calling lower down, or the lower level BAO is not setting default correctly. Fr Tommy, could you create an issue in JIRA on this, including link to here, then assign the issue to Josh and mark as PIQ. My guess is that it would cost about $125 - $250 to fix the bug and add a test to ensure the API works properly on this.
  
  > **Comments:**
  > **username_0**: https://issues.civicrm.org/jira/browse/CRM-21041  an issue is already created  
  
  ---
  
  