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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Searching for and exporting primary contacts
Pages: [1]

Author Topic: Searching for and exporting primary contacts  (Read 1152 times)

MarkSteven

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5
Searching for and exporting primary contacts
December 11, 2012, 03:14:23 pm
Hoping someone can help.

I'm running 4.1.3 / Drupal 7

I want to search for, export and mail primary contacts, where a primary contact is the user that first registers the organisation and has permissions to edit and control the records of subsidiary contacts. In other words - I want to be able to mail the responsible users for my member organisations.

Civi lets you search for "primary memberships" but this seems to be something else: it simply brings back the first relationship with an individual it finds, regardless of its status.

Basically it seems that the underlying relationships table is not exposed via the search interface at all.

My next thought was that if we automatically assign individuals to a "Primary Contact" group on sign up, we could simply filter on the group to access the data we need.

But actually the problem is the same - when it comes to exporting  my Primary Contact group, because it's associated with individuals, I only get names and email addresses - no actual address details, because on registration these are associated with the organisation. Argh!

Am I missing something obvious? If there's a better approach to this, happy to think about it!

Thanks,

Mark

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 and exporting primary contacts
December 11, 2012, 03:20:04 pm
Hi Mark - you may be missing something - it may not be obvious.

Yes it will work better if you can set a specific Relationship in place for your 'primary contacts'.

On Adv Search, top right, you can set to display the results to show Related contacts.

That should mean you can search for the people, but display the Org details. Not sure if that quite gets you where you need to be since you sound like you need Indiv Name but Org Address.

Other option is to make each Primary Contact 'share' the address of the Organisation. Manual task but depends how many contacts you are dealing with.

Another option is to put the Primary Contact name in to the 'greeting' for the Org - and then just export the Orgs details.

None of the above are 'code based' solutions - but if you have skills/budget I am sure someone will pop up with something cleverer than the above
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

lolas

  • I post frequently
  • ***
  • Posts: 134
  • Karma: 9
    • Freeform Solutions
  • CiviCRM version: Several
  • CMS version: Drupal
  • MySQL version: 5.1+
  • PHP version: Several
Re: Searching for and exporting primary contacts
December 13, 2012, 07:48:01 am
I just wrote this a custom search. It was for a customer on an older version of CiviCRM but could probably be cleaned up and made into an extension or quickly ported to the latest version.
Freeform Solutions provides technology and management consulting, website and database development, and managed internet hosting solutions for not-for-profit organizations (NFPs).

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 and exporting primary contacts
December 13, 2012, 09:45:11 am

hey lolas:

can you please port this to an extension and upgrade to the latest version (the schema has not changed at all with regard to this)

that would be really helpful to quite a few other civi users

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

MarkSteven

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5
Re: Searching for and exporting primary contacts
January 10, 2013, 06:33:15 am
Quote from: petednz on December 11, 2012, 03:20:04 pm
On Adv Search, top right, you can set to display the results to show Related contacts.

Thanks for the reply.. I've now had a chance to try this but no joy... We have the relationships of "Employee of" / "Employer of" to work with but neither seems to work. It brings back some results, but I'm unable to export a complete address which includes the organisation name.

As a workaround I have some custom fields which are associated with the organisation which capture individual "main contact" details. But I'm painfully aware that I'm defeating the purpose of the CRM in doing so. Argh.

MarkSteven

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5
Re: Searching for and exporting primary contacts
January 10, 2013, 06:34:57 am
Hi Lolas - can I second the call from Lobo... It looks like you'd be plugging a gap here and it would definitely help me out!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Searching for and exporting primary contacts

This forum was archived on 2017-11-26.