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 (Moderator: Dave Greenberg) »
  • Searching - selecting one relationship based on the existence of another.
Pages: [1]

Author Topic: Searching - selecting one relationship based on the existence of another.  (Read 850 times)

robbrandt

  • I post occasionally
  • **
  • Posts: 89
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: Drupal
  • MySQL version: 5.1.41-3ubuntu12.9
  • PHP version: 5.3.6
Searching - selecting one relationship based on the existence of another.
June 03, 2013, 11:57:37 am
I have need to email some persons in an organization.  Think of them as PR people.  I want to send an email to each one of these people who have another person in their organization that has a relationship as a trainer.  How do I select them?  I would like the results in a smart group if possible.

In English, I think I would phrase it as "create a group of PR people who work for an organization who also have Trainers in their organizations.

Both PR people and Trainers are defined by relationships to their organizations.

Thanks.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Searching - selecting one relationship based on the existence of another.
June 03, 2013, 12:37:03 pm
  • Advanced search
  • Relationships tab - enter your relationship type for trainers
  • Try it out, it should give you a list of all orgs that have trainers (if it lists the trainers and not the orgs, you got the relationship type backwards - switch it around)
  • Now at the top of the search, display results as related contacts, relationship type: PR person
Try asking your question on the new CiviCRM help site.

robbrandt

  • I post occasionally
  • **
  • Posts: 89
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: Drupal
  • MySQL version: 5.1.41-3ubuntu12.9
  • PHP version: 5.3.6
Re: Searching - selecting one relationship based on the existence of another.
June 03, 2013, 01:16:01 pm
Thanks, that appears to work great (at first glance).  I'll audit the results later to make sure I've got it right.

robbrandt

  • I post occasionally
  • **
  • Posts: 89
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: Drupal
  • MySQL version: 5.1.41-3ubuntu12.9
  • PHP version: 5.3.6
Re: Searching - selecting one relationship based on the existence of another.
June 03, 2013, 08:12:32 pm
OK, a bit of a wrinkle.

I find that most is correct, but there are some that I don't want.  What will work is to include only organizations that belong (a relationship) to a particular association.  So, revised...

"create a group of PR people who work for an organization that belongs to association A who also have Trainers in their organizations."

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Searching - selecting one relationship based on the existence of another.
June 04, 2013, 09:07:01 am
Well you have all of advanced search at your fingertips to make that happen - all of the search options are going to be applied to the org (since in reality you are searching for orgs and only displaying the results as "related contacts"). So you could filter by group, tag, or however you are tracking association memberships.
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Searching - selecting one relationship based on the existence of another.

This forum was archived on 2017-11-26.