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?

  • 1
    What 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? – Graham Nov 3 '14 at 19:19
  • 1
    Thanks 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 - CiviCooP Nov 5 '14 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 Murray Nov 6 '14 at 3:15

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.

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.