Documentation

CustomValue.php

This api exposes CiviCRM custom value.

Table of Contents

Functions

civicrm_api3_custom_value_create()  : array<string|int, mixed>
Sets custom values for an entity.
_civicrm_api3_custom_value_create_spec()  : mixed
Adjust Metadata for Create action.
civicrm_api3_custom_value_get()  : array<string|int, mixed>
Use this API to get existing custom values for an entity.
_civicrm_api3_custom_value_get_spec()  : mixed
Adjust Metadata for Get action.
_civicrm_api3_custom_value_gettree_spec()  : mixed
CustomValue.gettree API specification
civicrm_api3_custom_value_gettree()  : array<string|int, mixed>
CustomValue.gettree API
_civicrm_api3_custom_value_getdisplayvalue_spec()  : mixed
CustomValue.getdisplayvalue API specification
civicrm_api3_custom_value_getdisplayvalue()  : array<string|int, mixed>
CustomValue.getdisplayvalue API

Functions

civicrm_api3_custom_value_create()

Sets custom values for an entity.

civicrm_api3_custom_value_create(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>

Expected keys are in format custom_fieldID:recordID or custom_groupName:fieldName:recordID.

Tags
example:
  // entity ID. You do not need to specify entity type, we figure it out based on the fields you're using
  'entity_id' => 123,
  // (omitting :id) inserts or updates a field in a single-valued group
  'custom_6' => 'foo',
  // custom_24 is checkbox or multiselect, so pass items as an array
  'custom_24' => array('bar', 'baz'),
  // in this case custom_33 is part of a multi-valued group, and we're updating record id 5
  'custom_33:5' => value,
  // inserts new record in multi-valued group
  'custom_33:-1' => value,
  // inserts another new record in multi-valued group
  'custom_33:-2' => value,
  // you can use group_name:field_name instead of ID
  'custom_some_group:my_field' => 'myinfo',
  // updates record ID 8 in my_other_field in multi-valued some_big_group
  'custom_some_big_group:my_other_field:8' => 'myinfo',
throws
Exception
Return values
array<string|int, mixed>

['values' => TRUE] or ['is_error' => 1, 'error_message' => 'what went wrong']

_civicrm_api3_custom_value_create_spec()

Adjust Metadata for Create action.

_civicrm_api3_custom_value_create_spec(array<string|int, mixed> &$params) : mixed

The metadata is used for setting defaults, documentation & validation.

Parameters
$params : array<string|int, mixed>

Array of parameters determined by getfields.

civicrm_api3_custom_value_get()

Use this API to get existing custom values for an entity.

civicrm_api3_custom_value_get(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>

Array specifying the entity_id. Optionally include entity_type param, i.e. 'entity_type' => 'Activity' If no entity_type is supplied, it will be determined based on the fields you request. If no entity_type is supplied and no fields are specified, 'Contact' will be assumed. Optionally include the desired custom data to be fetched (or else all custom data for this entity will be returned) Example: 'entity_id' => 123, 'return.custom_6' => 1, 'return.custom_33' => 1 If you do not know the ID, you may use group name : field name, for example 'return.foo_stuff:my_field' => 1

Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

_civicrm_api3_custom_value_get_spec()

Adjust Metadata for Get action.

_civicrm_api3_custom_value_get_spec(array<string|int, mixed> &$params) : mixed

The metadata is used for setting defaults, documentation & validation.

Parameters
$params : array<string|int, mixed>

Array of parameters determined by getfields.

_civicrm_api3_custom_value_gettree_spec()

CustomValue.gettree API specification

_civicrm_api3_custom_value_gettree_spec(array<string|int, mixed> &$spec) : mixed
Parameters
$spec : array<string|int, mixed>

description of fields supported by this API call

Tags
throws
CRM_Core_Exception

civicrm_api3_custom_value_gettree()

CustomValue.gettree API

civicrm_api3_custom_value_gettree(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>
Tags
throws
CRM_Core_Exception
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

API result

_civicrm_api3_custom_value_getdisplayvalue_spec()

CustomValue.getdisplayvalue API specification

_civicrm_api3_custom_value_getdisplayvalue_spec(array<string|int, mixed> &$spec) : mixed
Parameters
$spec : array<string|int, mixed>

description of fields supported by this API call

civicrm_api3_custom_value_getdisplayvalue()

CustomValue.getdisplayvalue API

civicrm_api3_custom_value_getdisplayvalue(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>
Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

API result


        
On this page

Search results