API - CustomGroup - extends_entity_column_value
Overview
Filtering custom field groupy by extends_entity_column_value
is not possible via API. It is also not possible to create a custom field group via API explorer when trying to limit it by extends_entity_column_value
, because you have no option value to select.
Reproduction steps
- Create a new Custom Field Group via UI.
- Let it extend
Activity
and limit it toPhone Call
- Let it extend
- Try to retrieve that Custom Field Group via APIv3 or APIv4 by adding a filter on
extends_entity_column_value
- The field for the Option list will remain empty with a loading gif in the API Explorer
Current behaviour
\Civi\Api4\CustomGroup::get()
->addWhere('extends', '=', 'Activity')
->addWhere('extends_entity_column_value:name', '=', 'Phone Call')
->execute();
Returns an empty result. The value for extends_entity_column_value
seems to get dropped in the process of executing the query.
Creating the Custom Group via API works via code or browser, by creating the request manually.
https://dmaster.demo.civicrm.org/civicrm/api4#/explorer/CustomGroup/create?values=%5B%5B%22title%22,%22Phone%20Call%20Fields%22%5D,%5B%22extends%22,%22Activity%22%5D,%5B%22extends_entity_column_value:name%22,%22Phone%20Call%22%5D%5D
There is no drop down option in the API Explorer.
\Civi\Api4\CustomGroup::create()
->addValue('title', 'Phone Call Fields')
->addValue('extends', 'Activity')
->addValue('extends_entity_column_value:name', 'Phone Call')
->execute();
Expected behaviour
Existing custom field groups should be filterable by extends_entity_column_value
via API.
Environment information
- Browser: _Firefox 102.2.0
- https://dmaster.demo.civicrm.org
Comments
This seems to fail both with APIv3 and APIv4.