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 »
  • Drupal Webform Integration »
  • New field type: Contact Reference + Create Type
Pages: [1]

Author Topic: New field type: Contact Reference + Create Type  (Read 519 times)

JohnFF

  • I post frequently
  • ***
  • Posts: 235
  • Karma: 6
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.28
  • MySQL version: 5.5.31-1
  • PHP version: 5.3.27
New field type: Contact Reference + Create Type
December 01, 2014, 05:50:11 am
For an employer, if we type in a contact that doesn't exist, it creates that contact. But if the user types in a contact that does exist then it suggests that name as an option.

It would be great if we could create those types of contact-reference-with-creation fields ourselves!

Are we able to now, but I just don't know about it? Or are we not able to at all?
If you like empowering charities in a free and open way, then you're going to love Civi.

Email Amender: https://civicrm.org/extensions/email-amender
UK Phone Validator: https://civicrm.org/extensions/uk-phone-number-validator
http://civifirst.com
https://twitter.com/civifirst

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: New field type: Contact Reference + Create Type
December 01, 2014, 09:27:13 am
The "Current Employer" field currenly does this if you add it to a profile (well not as an autocomplete, but otherwise yes it will create and/or update employer contact based on your dedupe rules).
Try asking your question on the new CiviCRM help site.

JohnFF

  • I post frequently
  • ***
  • Posts: 235
  • Karma: 6
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.28
  • MySQL version: 5.5.31-1
  • PHP version: 5.3.27
Re: New field type: Contact Reference + Create Type
December 02, 2014, 08:04:49 am
This is in a webform.

And we need another custom field contact reference to do the same.

Do we just set it to not be an autocomplete contact reference in the webform?
If you like empowering charities in a free and open way, then you're going to love Civi.

Email Amender: https://civicrm.org/extensions/email-amender
UK Phone Validator: https://civicrm.org/extensions/uk-phone-number-validator
http://civifirst.com
https://twitter.com/civifirst

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: New field type: Contact Reference + Create Type
December 02, 2014, 08:09:11 am
Quote
This is in a webform.
Oh well in that case, yes you certainly can.
http://wiki.civicrm.org/confluence/display/CRMDOC/Webform+CiviCRM+Integration#WebformCiviCRMIntegration-WorkingwithExistingContacts
Try asking your question on the new CiviCRM help site.

JohnFF

  • I post frequently
  • ***
  • Posts: 235
  • Karma: 6
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.28
  • MySQL version: 5.5.31-1
  • PHP version: 5.3.27
Re: New field type: Contact Reference + Create Type
December 02, 2014, 12:17:43 pm
Hi Coleman,

Thanks for the response. Sadly when I do that I get the following (attached).

Ideally it should say just the name of the organisation that is typed in.

Would overwriting it in jQuery cause it to stop creating the entry?

Also, and this is a minor aside, you can only prepopulate it from a relationship or a parameter (i.e. cid6=). Can't we populate it from the entry that's in the filling in contact's custom field, as we can with other fields?
If you like empowering charities in a free and open way, then you're going to love Civi.

Email Amender: https://civicrm.org/extensions/email-amender
UK Phone Validator: https://civicrm.org/extensions/uk-phone-number-validator
http://civifirst.com
https://twitter.com/civifirst

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: New field type: Contact Reference + Create Type
December 02, 2014, 01:27:09 pm
Based on our irc discussion, the html issue can be solved by ensuring your copy of tokenInput has enableHTML = true.

Is there also a feature request to allow the "none found" prompt to include whatever the user has typed? Perhaps as a token so you could set it to something like "%input (new contact)" and get "ABC University (new contact)" if the user types "ABC University".
Try asking your question on the new CiviCRM help site.

JohnFF

  • I post frequently
  • ***
  • Posts: 235
  • Karma: 6
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.28
  • MySQL version: 5.5.31-1
  • PHP version: 5.3.27
Re: New field type: Contact Reference + Create Type
December 02, 2014, 04:26:19 pm
That's an ace idea.

What we're doing with our employer is not auto-suggesting anything.

For anyone to do this - follow the steps in the instructions, but don't enable the "existing contact" for contact 2. Just enable the organisation's name.
If you like empowering charities in a free and open way, then you're going to love Civi.

Email Amender: https://civicrm.org/extensions/email-amender
UK Phone Validator: https://civicrm.org/extensions/uk-phone-number-validator
http://civifirst.com
https://twitter.com/civifirst

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules »
  • Drupal Webform Integration »
  • New field type: Contact Reference + Create Type

This forum was archived on 2017-11-26.