Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-15915

API returns values of multi-select custom field in different format depending on the entitiy the custom field set is used for.

    Details

    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None

      Description

      There is a forum thread about this issue: http://forum.civicrm.org/index.php?topic=35646

      If you create a custom fieldset for a contact, with a custom field that is alphanumeric and multi-select, the API returns the values of this custom field as an array. E.g.

      { "contact_id":"1", "civicrm_value_mycustomset_4_id":"1", "custom_7":["A","B"], "id":"1" }

      When the custom field set is used for a relationship, and you do the same, the values for the custom field are returned as key-value pairs:

      {
      "id":"219",
      "contact_id_a":"96",
      "contact_id_b":"2",
      "relationship_type_id":"5",
      "is_active":"1",
      "description":"",
      "is_permission_a_b":"0",
      "is_permission_b_a":"0",
      "custom_8":

      { "A":"A", "B":"B" }

      ,
      "custom_8_3":

      { "A":"A", "B":"B" }

      }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              johanv Johan Vervloet
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: