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 Profiles (Moderator: Dave Greenberg) »
  • Help needed - Custom Data / Custom profile search.
Pages: [1]

Author Topic: Help needed - Custom Data / Custom profile search.  (Read 1963 times)

Chris7789

  • Guest
Help needed - Custom Data / Custom profile search.
February 05, 2009, 04:28:19 am
Hi all,

I have a custom data field. Which is Alphanumeric - CheckBox.
I have a profile that searches the value of this checkbox.

All the data I importing from another database has the output values to -1 or 0.
-1 means the option was selected
0 means it was not

I want the profile search to return any Organisations that have this box checked.

The question is, how do I make the custom data checkbox read the data as -1 = shows this result and 0 = dont show this result.

I hope that made sense, and any help would be GREATLY appreciated.

edit: So I seem to have worked out that creating a new field for each checkbox means I dont have an issues with setting the same values for each checkbox. However it wont allow me to set -1 as a value. Even if I could... Is this how I should be doing it? Because I am not using the profile as a means to enter the data. Only for searching.
« Last Edit: February 05, 2009, 04:36:12 am by Chris7789 »

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Help needed - Custom Data / Custom profile search.
February 05, 2009, 04:45:06 am
Might be easier if you can convert -1 to 1 before importing from another database ?

Kurund
Found this reply helpful? Support CiviCRM

Chris7789

  • Guest
Re: Help needed - Custom Data / Custom profile search.
February 05, 2009, 05:24:11 am
What about the 0's? Will they just be ignored (not returned as search results) if the Value is set to 1?

And am I going at this the right way? :)

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Help needed - Custom Data / Custom profile search.
February 05, 2009, 06:11:31 am
Quote
What about the 0's?

It should be fine. Created sample custom group: http://sandbox.civicrm.org/civicrm/admin/custom/group/field?reset=1&action=browse&gid=8

HTh

Kurund
Found this reply helpful? Support CiviCRM

Chris7789

  • Guest
Re: Help needed - Custom Data / Custom profile search.
February 05, 2009, 06:15:52 am
Right thats working. How do I get fields that have the 0 in not to show on the search results page? I only want the ones that have a 1 in to show.

Same question for other fields too.

eg. Organization comes up through a search on Organization Name. But theres no Postal Code entered. So can I make the Postal Code data field not show?

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Help needed - Custom Data / Custom profile search.
February 05, 2009, 06:59:26 am
Quote
Organization comes up through a search on Organization Name. But theres no Postal Code entered. So can I make the Postal Code data field not show?

When you search based on the result, you won't be able to remove Postal Code from selector.

Kurund
Found this reply helpful? Support CiviCRM

Chris7789

  • Guest
Re: Help needed - Custom Data / Custom profile search.
February 05, 2009, 07:41:22 am
So I can choose which fields get included in selector.

But theres no way to set fields that are blank to not show when hitting the view button of the organization? Every data field that is included in the profile will show up there whether its blank or not?

Thanks for replies btw.

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: Help needed - Custom Data / Custom profile search.
February 05, 2009, 08:33:39 am

you can do so by customizing your profile view template:

CRM/Profile/Page/Dynamic.tpl

you can put the tr element under a conditional based on $value

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Help needed - Custom Data / Custom profile search.

This forum was archived on 2017-11-26.