CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Using a custom data field as a filter
Pages: [1]

Author Topic: Using a custom data field as a filter  (Read 3529 times)

abrookins

  • I’m new here
  • *
  • Posts: 21
  • Karma: 5
    • Redspire (Blog)
Using a custom data field as a filter
October 07, 2009, 01:54:41 pm
Hey all,

Can we use custom data fields in CiviCRM 3.0 with CiviReport by default, or do we need to a write some PHP to make the filter?

Thanks,
Andrew

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Using a custom data field as a filter
October 07, 2009, 07:41:19 pm

In 3.0 we've enabled custom data for the contribution reports

you will need to add code to add custom data to the other reports

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

abrookins

  • I’m new here
  • *
  • Posts: 21
  • Karma: 5
    • Redspire (Blog)
Re: Using a custom data field as a filter
October 09, 2009, 11:20:50 am
Lobo,

Thanks for the reply. 

I did see in the contribute report classes that the code now includes custom data fields in the group by and display lists, but that change doesn't appear to offer those fields as filters.

If you add a custom field in the 3.0 demo and make it searchable, that field doesn't show up as a filter in contribute reports, though it is available as a group by and display column. 

We patched the contribute form classes to add custom data fields into the filter list using the same code that adds them to the group by and display columns, and the query building code threw an exception. 

So we made a couple of more small changes and now custom data fields are appearing in the filter list and seem to be working, though at a basic level (string comparisons).  Is filtering on custom data fields a planned feature, or just grouping and displaying those fields?

Andrew

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Using a custom data field as a filter
October 09, 2009, 02:24:36 pm

Not on the current feature list. Would be great if you'll could generalize it so it works for al data/html types and then submit it back as an issue, patch and a unit test!

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

abrookins

  • I’m new here
  • *
  • Posts: 21
  • Karma: 5
    • Redspire (Blog)
Re: Using a custom data field as a filter
October 09, 2009, 02:56:45 pm
Lobo,

Cool.  We'll work on it. :)

Andrew

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Using a custom data field as a filter

This forum was archived on 2017-11-26.