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) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • How to load the data(with all custom fields) of a contact with CiviCRM ID
Pages: [1]

Author Topic: How to load the data(with all custom fields) of a contact with CiviCRM ID  (Read 1464 times)

rogical

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 1
  • CiviCRM version: 4.2
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.3
How to load the data(with all custom fields) of a contact with CiviCRM ID
October 25, 2012, 02:44:58 am
I can't find the way, and failded searching out, thanks

my civicrm is in drupal.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: How to load the data(with all custom fields) of a contact with CiviCRM ID
October 25, 2012, 04:19:23 am
Can you explain a little more about what you are trying to do? What do you mean by loading all the data of a contact? In principle you should be able to do that using profiles, or using the API? Perhaps the developer guide can give you a clue, check http://book.civicrm.org/developer
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

rogical

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 1
  • CiviCRM version: 4.2
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.3
Re: How to load the data(with all custom fields) of a contact with CiviCRM ID
October 25, 2012, 07:36:26 pm
I have custom fields for a contact type, and can see their value on the contact detail page, but I can't get print the custom field value from:

$contact = civicrm_api('Contact','Get',array('version' =>3, 'id' => 2884)); dpm($contact);

the $contact object doesn't include custom field value!

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: How to load the data(with all custom fields) of a contact with CiviCRM ID
October 25, 2012, 08:16:18 pm
what about if you also call:
$custom = civicrm_api('custom_value','Get',array('version' =>3, 'entity_id' => 2884));
Try asking your question on the new CiviCRM help site.

rogical

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 1
  • CiviCRM version: 4.2
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.3
Re: How to load the data(with all custom fields) of a contact with CiviCRM ID
October 26, 2012, 06:20:58 am
finally solved by setting 'return' => 'custom_7', thanks the same :)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • How to load the data(with all custom fields) of a contact with CiviCRM ID

This forum was archived on 2017-11-26.