CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Custom field using contact reference and civi webform
Pages: [1]

Author Topic: Custom field using contact reference and civi webform  (Read 2098 times)

josue

  • I post occasionally
  • **
  • Posts: 81
  • Karma: 7
    • PTP
  • CiviCRM version: 3.4.4, 4.1.1
  • CMS version: Drupal 6.24, Drupal 7.12
  • MySQL version: 5.0
  • PHP version: 5.2
Custom field using contact reference and civi webform
May 23, 2013, 10:59:00 pm
hey folks,

i have a custom field that uses the individual contacts in a group to offer options, via contact reference.

i want to make that field available in a drupal webform. i am, of course, using the fabulous civicrm webform integration module!

i have it almost there, and wondering what i am missing.

contact2 just has the Existing Contact field checked.
contact1 has the custom field, with the option User Select chosen.

when i go to the Form Component list, the contact2 Existing Contact field is a Select List, default values is Auto - From Filters, and a Filter is set to limit the options to a group.

the contact1 custom field has Static Option, contact2 checked and is a Listbox.

when i choose an option from contact2 Existing Contact, it does save the response in the proper place (the contact1 custom field).

but when i bring up a record that has an entry for that custom field, it does not show up in the webform.

any ideas on how to properly set this up?

thanks!

--josue

josue

  • I post occasionally
  • **
  • Posts: 81
  • Karma: 7
    • PTP
  • CiviCRM version: 3.4.4, 4.1.1
  • CMS version: Drupal 6.24, Drupal 7.12
  • MySQL version: 5.0
  • PHP version: 5.2
Re: Custom field using contact reference and civi webform
May 24, 2013, 07:13:19 am
wondering if coleman is out there...

i have a field that is for a committee. i have a group for those people and the options for that field are populated by using a contact reference custom field, based on who is in the group.

i want to create a form that allows users to look up contacts and create an activity for them. while they are doing that, i want them to be able to see the committee member they are assigned to, and add or update that data.

if i cannot use the contact reference field in a civi webform, then i will change the way that custom field is structured.

but it feels like such an elegant way to do it, that i would love to figure this out.

any thoughts would be appreciated!

--josue

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Custom field using contact reference and civi webform
May 24, 2013, 10:13:22 am
Hey Josue.
What's the point of having the cc field be "user select" in the webform if the only possible choice is "contact 2"?
It ought to work either way, but the way you're doing it requires the user to do 2 things - fill in the autocomplete for contact 2, and also select "contact 2" for the cc field, which is redundant. Note that if they didn't do that then it of course wouldn't get properly saved, so that may be the problem.
Try asking your question on the new CiviCRM help site.

josue

  • I post occasionally
  • **
  • Posts: 81
  • Karma: 7
    • PTP
  • CiviCRM version: 3.4.4, 4.1.1
  • CMS version: Drupal 6.24, Drupal 7.12
  • MySQL version: 5.0
  • PHP version: 5.2
Re: Custom field using contact reference and civi webform
May 26, 2013, 02:56:56 pm
sorry, i don't think i am explaining this well.

i have a field called Committee. this is a contact reference field, limited to contacts in a group.

when i try to access this field in the Civi Webform, it is looking for a Contact ID from somewhere.

i am trying to get the data to show in this field. i am also trying to get the options to show in this field.

i thought i could access this info if i created Contact 2, but it is not working.

has anyone used a custom field that is of type Contact Reference in a Civi Webform?

--josue

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Custom field using contact reference and civi webform
May 26, 2013, 06:57:55 pm
Yes, that's the way to do it. It is a bit confusing due to the 2-step nature of the process, but I think you've got the right idea. Double check that you have done the following:
- Create contact 2 and expose their "existing contact" field to the webform
- Add the cc field for contact 1 and set it's option to be "contact 2" - no need to expose it to the webform
- Now back on the webform tab you need to do a bit of configuration for that "existing contact" field for contact 2. Set it to type autocomplete and also set its filter to the group of your choosing. You also probably want to disable "enforce permissions" on that field since you want your end-user to be able to freely select anyone in that group without Civi permissions getting in the way.
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Custom field using contact reference and civi webform

This forum was archived on 2017-11-26.