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) »
  • Filter on search (profile): how to get only organisations ?
Pages: [1]

Author Topic: Filter on search (profile): how to get only organisations ?  (Read 1562 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Filter on search (profile): how to get only organisations ?
April 15, 2008, 12:21:45 am
Hi,

I've found how to filter the search results on tags
/civicrm/profile?reset=1&gid=1&force=1&tag[29]=1

or on a country
/civicrm/profile?reset=1&gid=1&force=1&country-Primary=1020

But I haven't been able to filter to get only organisations,

/civicrm/profile?reset=1&gid=1&force=1&contact_type=Organization
(this doesn't work and you get Individuals and Households as well)

What is the proper syntax ?

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

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: Filter on search (profile): how to get only organisations ?
April 15, 2008, 01:57:30 am

the get params are for only the search fields that are exposed in the profile.

I dont think we expose organization types, hence i dont think setting contact_type=Organization (or household or individual) will work without some additional hacks

You'll need to hack the code to get this behavior. Your best bet is to check out CRM/Profile/Page/Listings.php at line 300 or so. You'll need to store the value in the session for future requests etc

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

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Filter on search (profile): how to get only organisations ?
April 15, 2008, 10:01:57 am
Quote from: xavier on April 15, 2008, 12:21:45 am
But I haven't been able to filter to get only organisations,

OR - you can create a Group w/ the Organizations you want to expose in this profile search - and then use the Profile 'Advanced Setting' --> Limit Listings to Group.

(If you want to expose all current and future contacts of type = Organization to this profile, then use a Smart Group created by searching for all contacts whose type is Organization from Find Contacts.)
Protect your investment in CiviCRM by  becoming a Member!

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Filter on search (profile): how to get only organisations ?
April 17, 2008, 08:16:42 pm
Hi,

Thanks for the suggestion to limit to a group to filter on org. Great idea !

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Filter on search (profile): how to get only organisations ?

This forum was archived on 2017-11-26.