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 Profiles (Moderator: Dave Greenberg) »
  • multi-value fields in CiviCRM Profile?
Pages: [1]

Author Topic: multi-value fields in CiviCRM Profile?  (Read 2642 times)

surgeonbor

  • Guest
multi-value fields in CiviCRM Profile?
May 13, 2010, 01:40:31 pm
Hi.  I'm experienced with Drupal, but brand new to CiviCRM.  I can't find the answer to this question anywhere in the forums or documentation...

In the "New Individual" form in CiviCRM, the Email and Phone fields (just as two examples), allow multiple entries, and there's a nice little 'add' link that exposes additional data entry fields if the user needs them.  However, when I add, say, the Phone field to CiviCRM Profile (so that I can expose it in Drupal user accounts), I can only add individual fields, e.g. Phone Primary, Phone Mobile, etc.  Is there a simple way to make those fields appear in the Drupal profile in the same way that they appear in CiviCRM, with the 'add' link?  Or do I have to recreate that functionality on the Drupal side via custom code?

Thanks.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: multi-value fields in CiviCRM Profile?
May 13, 2010, 02:15:07 pm

No simple way to do so.

You will need to write custom code to add it and then use the api to save it to the DB

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: multi-value fields in CiviCRM Profile?
May 13, 2010, 02:42:00 pm
You can't do this with core fields, but you can with custom fields. You can make a custom field (or group of fields) that repeats and then expose those in a profile and thereby allow Drupal users to update those fields, including the plus button, on their /user page.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

surgeonbor

  • Guest
Re: multi-value fields in CiviCRM Profile?
May 13, 2010, 02:51:12 pm
Thanks for the replies.  @hershel, I don't see any way to make a custom field that "repeats."  What do you mean by that?

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: multi-value fields in CiviCRM Profile?
May 13, 2010, 03:04:40 pm
Go to Administer -- Custom Data -- New Custom Data Group. Then choose "Contacts" for "Used For" and then you will see an option:

Does this Custom Data Group allow multiple records?

Hershel
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: multi-value fields in CiviCRM Profile?
May 13, 2010, 03:07:08 pm

We dont allow addition of multiple record custom fields in profiles. It complicates things a fair amount more than we could handle when we implemented that feature

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: multi-value fields in CiviCRM Profile?
May 13, 2010, 03:15:01 pm
My mistake. Lobo is, of course, correct. Now I recall that for the site where we wanted to do this, the issue was indeed that we would have had to hardcode the number of sets of data. I instead used a multi-valued CCK node type for that profile.

Sorry about that.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

surgeonbor

  • Guest
Re: multi-value fields in CiviCRM Profile?
May 13, 2010, 03:40:13 pm
Ok, so it sounds like the only solution is to programmatically add fields to the form (via hook_form_alter, I assume?) and then manually insert that data into the db when it's submitted, as Lobo originally suggested.  Thanks for all the help.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • multi-value fields in CiviCRM Profile?

This forum was archived on 2017-11-26.