The situation
I added a custom field to CiviEvents called regio (means region in English) and I want to be able to fetch CiviEvents by this field.
I'm on CiviCRM 4.6.6 and Wordpress 4.2.2
The problem
When I build the query using the API Explorer provided by CiviCRM, it always returns all CiviEvents, instead of only those to the selected region. This is the code the API Explorer generates:
$result = civicrm_api3('Event', 'get', array(
'debug' => 1,
'sequential' => 1,
'custom_10' => 1,
));
This gives the following results:
{
"is_error": 0,
"undefined_fields": [
"custom_10",
"page",
"noheader"
],
"version": 3,
"count": 25,
"values": [{...}, {...}]
}
As you can see, it says that custom_10 apparently is an undefined field, although it is generated by the API Explorer. And by the way, there actually are CiviEvents of which the region is set to Rotterdam.
I have spend days trying to debug this, going through the full backtrace of this function, but couldn't find anything. Does anyone have any idea why this presumably standard Civi-feature isn't working?
This screenshot gives the full settings I made in the API Explorer.