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) »
  • Search for all contacts that match criteria AND all their Relationships
Pages: [1]

Author Topic: Search for all contacts that match criteria AND all their Relationships  (Read 4869 times)

knob

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 4.2.0
  • CMS version: Drupal
  • MySQL version: 5.1.65-cll
  • PHP version: 5.3.16
Search for all contacts that match criteria AND all their Relationships
December 17, 2012, 01:35:17 am
Hello,

I want to know how I can search for contacts and all the relationships of the results?

For instance: search all organisations from the U.S. AND all the employees of these organisations?

In the advanced search I can only assign to search the relationship of a specific contact, so it is not dynamic.

I've been searching everywhere, couldn't find an answer.

Thank you!

Danny

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Search for all contacts that match criteria AND all their Relationships
December 17, 2012, 08:34:15 am
Hi Danny,

Two things:
* You don't need to fill in the "Target Contact" field.  So, for instance, you can search for everyone who has an "is employee of" relationship, without specifying "is employee of Organization X".  That should help you considerably.

* You're not going to be able to get the organizations and their related employees in a single search.  The way to deal with this is:
** Search for all US organizations.  Save as a smart group ("US Organizations")
** Search for all organizations with relationship "Is Employee Of", with "Target Contacts in Group" "US Organizations".
** Save this as a smart group ("Employees of US Organizations").

Now, you should be able to do a single search for groups "US Organizations" and "Employees of US Organizations".

Hope that helps!

Jon
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

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: Search for all contacts that match criteria AND all their Relationships
December 17, 2012, 11:48:06 am
Danny - it is unclear to me whether you are using the Display Results As (top right of Adv Search) - but indeed that only lets you specify a single Relationship Type.

You can use this for example to 'search for all Orgs' but display "all employees'

Have you looked at the Relationship based Reports?

It isn't clear to me what you want to do once you have the results you want so not sure if Reports will suffice.
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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Search for all contacts that match criteria AND all their Relationships

This forum was archived on 2017-11-26.