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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Unable to get address custom field
Pages: [1]

Author Topic: Unable to get address custom field  (Read 320 times)

Matthias de MAUROY - CYIM

  • I post occasionally
  • **
  • Posts: 59
  • Karma: 4
  • Working at CYIM
    • CYIM
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • MySQL version: 5.1.66-community-log
  • PHP version: 5.3
Unable to get address custom field
December 27, 2013, 12:53:50 am
Hi everyone !

I'm trying to create a relationship based on one of my custom fields.

Here is what I do :

Code: [Select]
$custom_fields = array('r_gion' => 'custom_37');
$get_params = array('entityID' => $objectRef->contact_id,$custom_fields['r_gion'] => 1);
$values = CRM_Core_BAO_CustomValueTable::getValues($get_params);

But Xdebug tells me it's empty, I'm able to get all of "contact" custom fields but none of "address" custom fields, some hints ?

Thx !
« Last Edit: December 27, 2013, 06:07:59 am by Matthias de MAUROY - CYIM »
Matthias de MAUROY
Analyste Web Developpeur
BU WEB
Tél. : +33 (0)2 99 22 83 40
Fax : +33 (0)2 99 22 83 41
Mail : m.mauroy@cyim.com
CYIM
31, rue de la Frébardière
35135 CHANTEPIE
FRANCE

Matthias de MAUROY - CYIM

  • I post occasionally
  • **
  • Posts: 59
  • Karma: 4
  • Working at CYIM
    • CYIM
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • MySQL version: 5.1.66-community-log
  • PHP version: 5.3
Re: Unable to get address custom field
December 27, 2013, 06:07:39 am
Solved !

The answer is as simple as this :

Code: [Select]
$get_params = array('entityID' => $contactAddr->id, 'entityType' => 'Address');
;-)
Matthias de MAUROY
Analyste Web Developpeur
BU WEB
Tél. : +33 (0)2 99 22 83 40
Fax : +33 (0)2 99 22 83 41
Mail : m.mauroy@cyim.com
CYIM
31, rue de la Frébardière
35135 CHANTEPIE
FRANCE

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Unable to get address custom field

This forum was archived on 2017-11-26.