$customField = new CRM_Core_BAO_CustomField(); $customFieldValue = $customField->getDisplayValue('my_custom_checkbox_field', 1);
$customField = new CRM_Core_BAO_CustomField(); $customFieldValue = $customField->getDisplayValue('my_custom_select_field', 2, 'Contact');In this example, the getDisplayValue function is used to retrieve the display value of a custom select field with the name 'my_custom_select_field', the entity id of 2, and the entity name 'Contact'. Package library: CiviCRM, an open-source CRM system that is widely used by non-profit organizations.