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) »
  • Synchronising CiviCRM contact data to Drupal user profile fields
Pages: [1]

Author Topic: Synchronising CiviCRM contact data to Drupal user profile fields  (Read 785 times)

galdi56

  • I’m new here
  • *
  • Posts: 19
  • Karma: 0
  • CiviCRM version: 4.1.beta3
  • CMS version: Drupal 6
  • MySQL version: 5.1.49
  • PHP version: PHP Version 5.3.3-7+squeeze3
Synchronising CiviCRM contact data to Drupal user profile fields
October 09, 2012, 08:18:15 am
Yes thats right I want to keep a copy of the contact data such as name, company, address that is contained in the CiviCRM contact record in Drupal Profile fields. Most examples i find work the other way - i.e. from drupal to civicrm - which i think is easier, but just not possible for us.

This is a hack to enable me to use the salesforce API module to reflect changes between our CiviCRM based membership system and our core Salesforce.com CRM (This is just a "have to do" for us.) This salesforce module cannot see the civicrm datafields.

Anyone recommend where to start here - I think i need to develop a custom module (it will be my first...) as I can't see anything out-there that does this? Probably based around the hook_civicrm_post hook.

It gets complicated as the user making the change in civicrm may be a local administrator and therefore the user$ object may not be set correctly at the time of posting - therefore it needs to do direct databse calls.

Any help or examples greatfully appreciated as this is quite a challenge as my php knowledge is non-existent.

To summarise - just an example of how to update a user profile programatically with civicrm user data (but you cant assume the logged in user is the one doing the change!)

err... help!
« Last Edit: October 09, 2012, 09:33:48 am by galdi56 »

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Synchronising CiviCRM contact data to Drupal user profile fields
October 09, 2012, 12:39:17 pm
Matt's field api module for civicrm basically does exactly that:
http://forum.civicrm.org/index.php/topic,24292.msg108311.html#msg108311
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) »
  • Synchronising CiviCRM contact data to Drupal user profile fields

This forum was archived on 2017-11-26.