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) »
  • Custom data - search for null
Pages: [1]

Author Topic: Custom data - search for null  (Read 678 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Custom data - search for null
May 20, 2009, 02:45:55 pm
Hi all,

I could swear I did this before but now can't re-do this.

I want to add a custom field which can either display as 'yes' or 'no'. In this case it is 'Uniform issued'. The field is updated to 'yes' via a profile batch update by the administrator so it will actually not be set until it is set to yes.

I want to be able to search for all people who have not been issued a uniform. I thought I had this working through advanced search and setting No as the default before but now I seem to only be able to get it through search builder - is null.

Any thoughts? A Required checkbox with a default of No is intuitively No unless set to Yes. But in the world of databases there is a third option...

Eileen
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Custom data - search for null
May 21, 2009, 01:52:28 pm
Default will only get set if that persons record/custom group is opened and saved. maybe an export and re-import? otherwise need to fill table with 'no' in backend (am I making sense or too much good herefordshire cider?)  :P

grr - or create group (X) = all - then find all with Uniform = Yes and remove from Group

or create a Smart Group (Y) from Search Build for = Null or = No - then use Custom search to find 'those in GroupX but not in GroupY

Yeah i know - too much cider inside
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Custom data - search for null
May 21, 2009, 04:33:46 pm
Hmm - they are participant records  so your clever group-y options won't work but I think I can edit it quite easily. It's just that I thought I had managed to capture existing records in my Yes/No field & then they escaped me again.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Custom data - search for null
May 21, 2009, 05:12:23 pm
Actually - this is trickier than I realised. I don't want people registering for an event to see or fill out this field - it is part of a later administrative process so when they enrol for the event it is not part of the profile that they see. Thus, the default value (no or 0) is not entered against them and the 'find participants' search doesn't work to find people who have not had it set to yes.

Smart groups apply to contact records not participant records - ditto the search builder.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Custom data - search for null

This forum was archived on 2017-11-26.