Skip to content

Instantly share code, notes, and snippets.

@futurefirst
futurefirst / Insert.php
Last active August 29, 2015 14:21
How to get the new record ID, when adding a record to a multi-value custom field using the API?
<?php
/**
* CustomValue.Insert API specification (optional)
* This is used for documentation and validation.
*
* @param array $spec description of fields supported by this API call
* @return void
* @see http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
*/
@futurefirst
futurefirst / gist:a4e1d4346fa99b50cb8e
Created May 6, 2015 15:18
Extending a dedupe rule to change a condition to stipulate a specific value, and to add a condition on a subtype custom field
/**
* Implementation of hook_civicrm_dupeQuery
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_dupeQuery
*/
function extendeddedupe_civicrm_dupeQuery($obj, $type, &$query) {
if ($obj->id != STUDENT_DEDUPE_RULE_ID || $type != 'table') {
return;
}
watchdog(