Answers.Body: <p>As artfulrobot suggested, this is not implemented, <a href="https://issues.civicrm.org/jira/browse/CRM-16036" rel="nofollow">but will be in V4.7</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-26T13:46:40.153Z
Answers.LastActivityDate: 2015-08-26T13:46:40.153Z
Answers.UserDisplayName: user825
Body: <p><strong>The situation</strong></p>
  
  <p>I added a custom field to CiviEvents called <strong>regio</strong> (means <strong>region</strong> in English) and I want to be able to fetch CiviEvents by this field.</p>
  
  <p>I'm on CiviCRM 4.6.6 and Wordpress 4.2.2</p>
  
  <p><strong>The problem</strong></p>
  
  <p>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:</p>
  
  <pre><code>$result = civicrm_api3('Event', 'get', array(
    'debug' =&gt; 1,
    'sequential' =&gt; 1,
    'custom_10' =&gt; 1,
  ));
  </code></pre>
  
  <p>This gives the following results:</p>
  
  <pre><code>{
      "is_error": 0,
      "undefined_fields": [
          "custom_10",
          "page",
          "noheader"
      ],
      "version": 3,
      "count": 25,
      "values": [{...}, {...}]
  }
  </code></pre>
  
  <p>As you can see, it says that <strong>custom_10</strong> 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 <strong>Rotterdam</strong>.</p>
  
  <p>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?</p>
  
  <p>This screenshot gives the full settings I made in the API Explorer.</p>
  
  <p><a href="https://i.sstatic.net/FKmGD.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/FKmGD.png" alt="enter image description here"></a></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-21T16:02:27.047Z
Comments.Text: I think this is not implemented, but work has begun. See my answer to [related question on custom fields on activities](http://civicrm.stackexchange.com/a/4865/35)
Comments.UserDisplayName: artfulrobot
Tags: <civievent><wordpress><custom-fields>
Title: CiviEvent - Search by custom field
ThreadText: # CiviEvent - Search by custom field
  
  (Asked by: username_0 on 2015-08-19)
  
  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.
  
  **Tags:** civievent, wordpress, custom-fields
  
  > **Comments:**
  > **username_1**: I think this is not implemented, but work has begun. See my answer to [related question on custom fields on activities](http://civicrm.stackexchange.com/a/4865/35)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2015-08-26. Score: 2 | Accepted answer
  
  As username_1 suggested, this is not implemented, [but will be in V4.7](https://issues.civicrm.org/jira/browse/CRM-16036)
  
  
  ---
  
  