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) »
  • Searching for individual employed by orgs in a certain group
Pages: [1]

Author Topic: Searching for individual employed by orgs in a certain group  (Read 804 times)

leupi

  • I post frequently
  • ***
  • Posts: 192
  • Karma: 2
Searching for individual employed by orgs in a certain group
June 10, 2010, 01:47:53 pm
That title was a mouthful...

I have individuals that are set up via relationships as Employees Of organizations. Some of these organizations are members of a group. I want to be able to do a search that comes up with all of the individuals that belong to organizations that are members of a specific group. Confused yet?

For example:
Jon, Frank, and Mary are employees of Alabama Program, Mississippi Program, and Florida Program, respectively (via relationships). Those programs (organizations) are all member of the group 'NE Region'. I want to be able to somehow search for all individuals that belong to an organization that is in the NE Region group. In this case, I want Jon, Frank, and Mary to come up.

We want to be able to email all individuals that are employed by all organizations that are in the group NE Region, we don't want to just email the organizations themselves.

Any thoughts on how best to do this?

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: Searching for individual employed by orgs in a certain group
June 10, 2010, 05:57:39 pm

1. create a custom search that implements your spec below. check

http://wiki.civicrm.org/confluence/display/CRMDOC/Custom+Search+Components

2. Create a smart group using this custom search for the NE Region

3. Use this smart group to send a mailing

4. make sure u test before u do #3 :)

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

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Searching for individual employed by orgs in a certain group
June 10, 2010, 11:47:54 pm
Hi,

Do note that the current employer company id is stored in the individual records, ie you don't have to join on the relationship to fetch the list.

Essentially, if you find the query to fetch the contacts in a group, replace the civicrm_contact.contact_id by civicrm_contact.employer_id in the join, you got it.

Please share the result, I can imagine having other people using it

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) »
  • Searching for individual employed by orgs in a certain group

This forum was archived on 2017-11-26.