6

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.

enter image description here

2

As artfulrobot suggested, this is not implemented, but will be in V4.7

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.