I am using Drupal 7 and CiviCRM 4.4.2. I have created a form with Webform CiviCRM integration that creates a new case. However, the case subject should be generated in CiviCRM, based on a standard pattern. The code replaces {contactName}-{caseType}-{caseId} with the values in the civicrm_post hook. How do I set the default value of the case subject in the Webform whilst not showing the field on the webform?
-
1What default value do you want to set? If it simply a placeholder that is going to be overwritten by your hook presumably it doesn't matter what the default is? that aside, can you create the field, then give it a default value and and set the widget to 'Hidden' in the webform component settings so that is doesn't appear on the form?– GrahamCommented Nov 3, 2014 at 19:19
-
1Thanks Graham, did that and that solves it. So I tick the Case Status on the webform, give it a default {contactName}-{caseType}-{caseId} and then set the widget to 'Hidden' in the forms. Like a charm :-)– ErikH - CiviCooPCommented Nov 5, 2014 at 9:42
-
Graham or ErikH could you post comment as an answer so it can be noted by system and voted on by users? Thx– Joe MurrayCommented Nov 6, 2014 at 3:15
Add a comment
|
1 Answer
In the webform, give the field the default value that you want to use, and then change the field widget to 'Hidden' so that the field is not exposed to the user on the form. The default value will then be submitted, and subsequently modified/overridden by your hook.