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 Import (Moderator: Yashodha Chaku) »
  • Importing values for "Contact Reference" custom data field?
Pages: [1]

Author Topic: Importing values for "Contact Reference" custom data field?  (Read 1796 times)

jefferymac

  • I’m new here
  • *
  • Posts: 10
  • Karma: 2
Importing values for "Contact Reference" custom data field?
November 30, 2009, 04:10:55 pm
I have a custom data field of the type "contact reference" associated with my Organizations; I want to use this contact reference field to point to a "primary rep" and a "billing rep" for the Organizations. Both the primary and billing rep are Individual contacts.

I'm trying to do an import that Updates the Organizations, and inserts a name into one of the contact reference fields, but I'm unable to do so -- CiviCRM reports invalid values for each name. The names I'm using definitely exist as Individual Contacts, but I can't figure out how to format the rows in my CSV file so that the data will import successfully.

Is it possible to import data for a contact reference field? If so, how should I approach it?
CiviCRM: 3.02
Drupal: 6.14

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: Importing values for "Contact Reference" custom data field?
November 30, 2009, 05:03:11 pm

I dont think we handle import of contact reference fields very well. You might want to send in the contact is of the "primary rep" and "billing rep" and see if that works

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

jefferymac

  • I’m new here
  • *
  • Posts: 10
  • Karma: 2
Re: Importing values for "Contact Reference" custom data field?
December 01, 2009, 04:15:26 pm
Thanks for the pointer Lobo. I tried your suggestion and Import to ContactReference fails with a contact ID as well, so I dug into the code a bit. I was able to grok how Import uses validation rules, and there's no ruleset in place for ContactReference data types, so it's logical that it errors out no matter what value is used. I was able to hack together a quick-fix for my project, but will submit a patch for import by contact ID once I get out of the weeds.
CiviCRM: 3.02
Drupal: 6.14

Marty

  • I post occasionally
  • **
  • Posts: 67
  • Karma: 14
    • Boulder County Arts Alliance
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.26
  • MySQL version: 5.5.37
  • PHP version: 5.4.27
Re: Importing values for "Contact Reference" custom data field?
June 16, 2010, 10:31:52 pm
I have not seen any action on this, so I've opened a new issue (CRM-6377) and submitted a patch.  I successfully imported a large set of contacts with Contact Reference custom data fields using this fix.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Importing values for "Contact Reference" custom data field?
June 16, 2010, 11:13:57 pm
Hi,

I've been having quite good success using Migrate to populate contact reference fields. I'm still pretty early in my experiments with it - I wrote an initial blog & will write up how I get on
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Importing values for "Contact Reference" custom data field?

This forum was archived on 2017-11-26.