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) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Relationship create API and Custom values
Pages: [1]

Author Topic: Relationship create API and Custom values  (Read 317 times)

jaapjansma

  • I post frequently
  • ***
  • Posts: 247
  • Karma: 9
    • CiviCoop
  • CiviCRM version: 4.4.2
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5.4
Relationship create API and Custom values
April 18, 2014, 07:04:54 am
Hey all,

I want to do the following relationship create API call:
&contact_id_b=4
&contact_id_a=3
&relationship_type_id=16
&start_date=20140418134116
&is_permission_b_a=1
&custom_15=2
&custom_16=gemeente
&custom_28=1

The relationship is created but the custom values or not updated.
Developer at Edeveloper / CiviCoop

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Relationship create API and Custom values
April 19, 2014, 12:46:52 am
That does seem like a bug, The custom fields are set in CRM_Contact_BAO_Relationship::add which is called by CRM_Contact_BAO_Relationship::create & in turn by the api function. The awful legacy format_params in that api DOES call   _civicrm_api3_custom_format_params($params, $values, 'Relationship'); so there is no obvious reason why this is not working :-(
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) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Relationship create API and Custom values

This forum was archived on 2017-11-26.