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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Searching custom checkbox fields
Pages: [1]

Author Topic: Searching custom checkbox fields  (Read 2711 times)

afrazier

  • Guest
Searching custom checkbox fields
March 04, 2009, 09:22:16 am
Hello,
I read this post http://forum.civicrm.org/index.php/topic,3215.0.html  and attempted to reply, but was advised to start a new thread- so here it is. 

I have a custom field for Individuals in my DB called Type.  This field has 3 checkbox options.  Numerous check boxes can be checked for each individual- in other words, more than one box can be checked.  For this example we'll say that under the Type field, the checkbox options are:  red, blue, and green.  I have 5 records who just have red checked, 1 record with red and green checked, and 1 record with all 3 colors checked.  I also have 10 records who do not have any Type checked.

When I go into search builder, I would like to search for ALL individuals who have ANYTHING checked in the Type field.   I've found that this is an impossible search to run.  I set it up so that:

SEARCH FOR:

Individual-->Type = red
OR
Individual-->Type = blue
OR
Individual-->Type = green
OR
Individual-->Type = red AND
Individual-->Type = blue
OR
Individual-->Type = blue AND
Individual-->Type = green
OR
Individual-->Type = red AND
Individual-->Type = green
OR
Individual-->Type = red AND
Individual-->Type = blue AND
Individual-->Type = green

You'd think this search would work... I've included all the possible permutations!  But the ONLY records it finds are those with ONLY red checked.  I have 5 records with just red checked, 1 record with red and green, and 1 record with all 3 colors.  The search leaves out both records with multiples checked. 

I then ran a search to try and JUST find the 1 record with all 3 boxes checked:

Individual-->Type=red AND
Individual-->Type=blue AND
Individual-->Type=green

This didn't work either.  There seems to be, literally, no search that I can build that will return my record that has all 3 Type boxes checked.

Any ideas??  (It should be noted that, while I have a good user knowledge of CiviCRM, I am most definitely not a programmer and do not know MySQL or PHP).  I'm running CiviCRM 2.0.6.

ctarascio

  • I post frequently
  • ***
  • Posts: 334
  • Karma: 30
    • American Friends Service Committee
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 6.26
  • MySQL version: 5.5.20
  • PHP version: 5.3.13
Re: Searching custom checkbox fields
March 04, 2009, 09:41:11 am
Hello,
This was fixed in 2.1 but you can apply the fix to 2.0 as well.

For the 2.1 fix, please reference: http://issues.civicrm.org/jira/browse/CRM-3190.

For the 2.0 patch, please reference: http://fisheye.civicrm.org/changelog/CiviCRM?cs=15008.

Also, the 3215 post that you reference has a lot of information in it related to this topic.

Does this help?

Cynthia



afrazier

  • Guest
Re: Searching custom checkbox fields
March 04, 2009, 11:23:31 am
Thanks Cynthia... it helps, but I looked at the links and it's a bunch of code... I am (unfortunately) not a programmer, and don't have a clue what to do with this code.  I guess I would need to hire someone to implement these updates... unless you have a different suggestion.

afrazier

  • Guest
Re: Searching custom checkbox fields
March 04, 2009, 11:39:36 am
...just talked this over with my company- we will be hiring someone to do the upgrade for us soon.  Thanks again for the help!

ctarascio

  • I post frequently
  • ***
  • Posts: 334
  • Karma: 30
    • American Friends Service Committee
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 6.26
  • MySQL version: 5.5.20
  • PHP version: 5.3.13
Re: Searching custom checkbox fields
March 04, 2009, 11:43:59 am
Hi,
I think that is a wise move on all counts.

Are you aware that the Civi team is about to release 2.2: http://wiki.civicrm.org/confluence/display/CRM/CiviCRM+v2.2.

You might want to wait for this as doing so will get you on the latest and greatest  ;)

Good luck afrazier,
Cynthia

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Searching custom checkbox fields

This forum was archived on 2017-11-26.