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 Organization contacts where "Employer of" relationship is null?
Pages: [1]

Author Topic: Searching for Organization contacts where "Employer of" relationship is null?  (Read 1865 times)

Rob McCausland

  • I post occasionally
  • **
  • Posts: 33
  • Karma: 0
    • Community Media Database
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6.20
  • MySQL version: 5
  • PHP version: 5.2
Searching for Organization contacts where "Employer of" relationship is null?
March 14, 2011, 05:13:42 am
Just trying to get a quick list of which of my 1800 organization contacts do not yet have an "employer of" relationship established.  When I run the query in Search Builder, I get the same number or records with and without the filter "employer-of is null."  I do not believe all my records have this relationship established yet. 

I've tried to export the resulting contacts, selecting the last name and email fields from the Organization's "Employer of" criteria, but the report hangs and times out.

I've already discovered there's apparently no (non-coding) way to batch update relationship permissions.  Now it's looking like there's no easy way to inspect the relationship fields at all other than each record at a time.  Can anyone shed any light on this situation?  Thank you.



By the way - my database - http://communitymediadatabase.org - contains records for US community access television providers and low power FM radio stations.  It allows for public searches (upon log-in) and authorized providers' updates (for those with permissioned relationships).  So far, it actually appears to be working as intended.  Thank you, everyone here, for answering my newbie questions.  ~ Rob

Rob McCausland

  • I post occasionally
  • **
  • Posts: 33
  • Karma: 0
    • Community Media Database
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6.20
  • MySQL version: 5
  • PHP version: 5.2
Re: Searching for Organization contacts where "Employer of" relationship is null?
March 14, 2011, 05:28:48 am
Well, the report probably hangs because my server takes more than 2 minutes to process the 1800 records export.  However, when I cut down the records to 215 (just one state), the report does come in, but reveals that the "employer of" fields are not the Individuals employed - but the Organizations themselves.  Really seems like a "can't get there from here" situation.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Searching for Organization contacts where "Employer of" relationship is null?
March 14, 2011, 05:48:42 am
Quote from: Rob McCausland on March 14, 2011, 05:28:48 am
Well, the report probably hangs because my server takes more than 2 minutes to process the 1800 records export.

That's most likely the issue, yes.

Quote from: Rob McCausland on March 14, 2011, 05:28:48 am
However, when I cut down the records to 215 (just one state), the report does come in, but reveals that the "employer of" fields are not the Individuals employed - but the Organizations themselves.  Really seems like a "can't get there from here" situation.

Not sure what you mean by that. If your relationships are wrong, you would have to adjust those by hand I think.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Rob McCausland

  • I post occasionally
  • **
  • Posts: 33
  • Karma: 0
    • Community Media Database
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6.20
  • MySQL version: 5
  • PHP version: 5.2
Re: Searching for Organization contacts where "Employer of" relationship is null?
March 14, 2011, 06:26:24 am
Thanks - I am expecting to update the records as necessary, one at a time.  My problem comes in trying to identify which ones of the 1800 do not yet have a relationship established.  Inspecting all 1800 records one at a time will accomplish that - but I was hoping that some sort of search would yield me just the subset I needed to be working with.  And I just can't figure out how to successfully construct that search.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Searching for Organization contacts where "Employer of" relationship is null?
March 14, 2011, 10:31:48 am
I am not sure actually. It could be done low-tech style directly in MySQL :)
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Rob McCausland

  • I post occasionally
  • **
  • Posts: 33
  • Karma: 0
    • Community Media Database
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6.20
  • MySQL version: 5
  • PHP version: 5.2
Re: Searching for Organization contacts where "Employer of" relationship is null?
March 16, 2011, 07:48:08 pm
Actually - it's much easier.  I just noticed there is a pre-fabbed "Relationship" report, which lets you add all resulting the contacts to a group.  Do that, and search for all those not in that group, and you have all those who have no relationships established.

um - I think the word is - "Duh."

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: Searching for Organization contacts where "Employer of" relationship is null?
March 16, 2011, 09:46:40 pm
Then you could do same by Adv Search for the RElationship - create Group - search for 'not in that group'?
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

Rob McCausland

  • I post occasionally
  • **
  • Posts: 33
  • Karma: 0
    • Community Media Database
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6.20
  • MySQL version: 5
  • PHP version: 5.2
Re: Searching for Organization contacts where "Employer of" relationship is null?
March 21, 2011, 06:19:01 am
Thanks - I'm not sure I follow you. After I get the Relationship report, I did create the group, and then in Advance Search I searched for those not in it.  And that should work have worked, I thought.

However, it seems that using the action "assign to group" on the contacts resulting from a "Relationship Report" only affects the Contact A side of the relationship, not the Contact B side.  There are several configurations for that report - and I tried a few likely candidates - but I could only ever add the "employee" to a group, not the "employer."

My work-around was to download that report as a CSV, then re-upload it, filling in the affected Organization contact records with a new custom field called "Related."  Then, I was able to search for all Org contacts where that field was null.

Thanks again.

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: Searching for Organization contacts where "Employer of" relationship is null?
March 21, 2011, 11:14:49 am
Rob - my suggestions which i am not sure you have ruled out - was to just use Adv Search to find Orgs with 'employer of' - create a Smart Group - then use the Custom Search to rule all of those out of your search - ie presumably

Group A = All Orgs
Group B = All Orgs with Employer of relationship

Am I making sense?
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

Rob McCausland

  • I post occasionally
  • **
  • Posts: 33
  • Karma: 0
    • Community Media Database
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6.20
  • MySQL version: 5
  • PHP version: 5.2
Re: Searching for Organization contacts where "Employer of" relationship is null?
March 21, 2011, 12:49:46 pm
Yes, thank you, Peter - that does indeed work for my purposes.  "Advanced Search" is not something I'd used before, so no, I hadn't ruled it out.  (I mis-spoke in my early reply - it was Search Builder I'd used, not Advanced Search.)  As a mostly self-taught newbie, I'm slowly finding whole feature sets exist which help me do what needs to be done.  Thanks for persisting with your suggestion.  ~ Rob

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: Searching for Organization contacts where "Employer of" relationship is null?
March 22, 2011, 02:42:51 am
Glad I could help you find your way to something that worked.
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) »
  • Searching for Organization contacts where "Employer of" relationship is null?

This forum was archived on 2017-11-26.