Details
-
Type: New Feature
-
Status: In Quality Assurance
-
Priority: Trivial
-
Resolution: Unresolved
-
Affects Version/s: 4.7
-
Fix Version/s: Unscheduled
-
Component/s: CiviCRM API
-
Labels:
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:Developer Doc
-
Sprint:4.7.10 api, 4.7.11 API
-
Funding Source:Needs Funding
Description
We have a multiselect custom field on relationships. Now I would like to use the API to retrieve e.g. all relationships where 'FI' is contained in the values selected for that custom fields. Something like this:
$result = civicrm_api3('Relationship', 'get', array( 'sequential' => 1, 'custom_15' => array('CONTAINS' => 'FI'), ));
I tried to do this:
$result = civicrm_api3('Relationship', 'get', array(
'sequential' => 1,
'relationship_type_id' => 13,
'custom_15' => array('LIKE' => '%' . CRM_Core_DAO::VALUE_SEPARATOR . "FI" . CRM_Core_DAO::VALUE_SEPARATOR . '%')
));
But that did not work:
CiviCRM_API3_Exception: [2001: '%' is not a valid option for field custom_15