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) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 2.1 Release Testing »
  • Importing indivs with orgs - current employer behavior
Pages: [1]

Author Topic: Importing indivs with orgs - current employer behavior  (Read 3862 times)

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Importing indivs with orgs - current employer behavior
September 24, 2008, 12:40:33 pm
I realize that the current employer behavior has been restructured significantly in v2.1. But I'm not sure the new structure is as practical as it needs to be. Couple things --

1) In previous versions, when you imported a contact and set their organization data field to Organization > Org Name, it created both the individual's record and an organization record, and built the relationship between them. v2.1 does this as well, BUT, it doesn't recognize that imported and related org record as the current employer for the indiv record. It would appears as though that can only be done after the import, and on a contact by contact basis.

2) It seems the current employer field is (mostly?) disconnected from the relationships. That doesn't make sense to me. For example, if John Doe is employed by ACME company, I need to create a relationship for him in the relationship tab AND select ACME as his current employer in the summary edit tab. Some ideas for how to improve this:

a) Option in the relationship edit form to make a certain relationship the current employer. You'd need to only make that option available for the correct relationship type.
b) In the contact edit form, the user should be able to select a current employer from a list of existing relationships on the record. Doing a search using the dynamic dropdown is a pain, especially if you've already done the work to find the org in the relationship tab.

-Brian
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Importing indivs with orgs - current employer behavior
September 24, 2008, 01:00:38 pm
Quote
1) In previous versions, when you imported a contact and set their organization data field to Organization > Org Name, it created both the individual's record and an organization record, and built the relationship between them. v2.1 does this as well, BUT, it doesn't recognize that imported and related org record as the current employer for the indiv record. It would appears as though that can only be done after the import, and on a contact by contact basis.

Yes currently you will have to manually add current employer relationship via Contact Edit form.

Quote
a) Option in the relationship edit form to make a certain relationship the current employer. You'd need to only make that option available for the correct relationship type.

there is already an issue for this in 2.2, http://issues.civicrm.org/jira/browse/CRM-3532

Quote
b) In the contact edit form, the user should be able to select a current employer from a list of existing relationships on the record. Doing a search using the dynamic dropdown is a pain, especially if you've already done the work to find the org in the relationship tab.

Currently if you have "Employee of" relationship with "Test Org". Then if you select this "Test Org" as current employer then it update that particular relationship as "Current Employer" relationship.

HTH

Kurund


Found this reply helpful? Support CiviCRM

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Importing indivs with orgs - current employer behavior
September 24, 2008, 01:12:23 pm
Follow up --

Re: importing -- when importing indivs such that parent orgs are created, I think that relationship should be set as the current employer by default. I just imported 2000 records into a db, and now am looking at having to create the current employer status by hand?

Re: my suggest b) --
My concern was that you can't choose the current employer from existing relationships -- you have to search through all the orgs. Having the ability to search through all the orgs is fine -- and necessary. I just think it would be helpful if the user could select from a list of existing relationships as well.

For some reason I thought this ability was present in an earlier version of v2.1, so I was surprised to see it missing.

-Brian
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Importing indivs with orgs - current employer behavior
September 24, 2008, 01:46:45 pm
Kurund,
Where is the current employer status stored? I figured it would be in the relationships table, but it's not.
-Brian
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Importing indivs with orgs - current employer behavior
September 24, 2008, 01:48:26 pm
Nevermind -- found it in the contact table. Makes sense.
-Brian
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Importing indivs with orgs - current employer behavior
September 25, 2008, 11:13:28 am
Quote
Re: importing -- when importing indivs such that parent orgs are created, I think that relationship should be set as the current employer by default. I just imported 2000 records into a db, and now am looking at having to create the current employer status by hand?

Agree. Updated: http://issues.civicrm.org/jira/browse/CRM-3532

Quote
Re: my suggest b) --
My concern was that you can't choose the current employer from existing relationships -- you have to search through all the orgs. Having the ability to search through all the orgs is fine -- and necessary. I just think it would be helpful if the user could select from a list of existing relationships as well.

I guess we will skip this for now. Mostly because in v2.2 user will be able to do this from "Relationship" tab.

thanx

Kurund
« Last Edit: September 25, 2008, 11:15:44 am by Kurund Jalmi »
Found this reply helpful? Support CiviCRM

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Importing indivs with orgs - current employer behavior
September 27, 2008, 04:22:44 pm
I just did a test upgrade and was glad to see that the current employer field did carry over through the upgrade process.

Question --
I'd like to see that field visible on the default search result set screen. The field is not currently available to the template. Any ideas on what would be the best way to call it in the script? Is there an API that grabs it quickly using the contact id?
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

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: Importing indivs with orgs - current employer behavior
September 27, 2008, 05:51:34 pm

You can retrieve the organization name with a simple query on the civicrm_contact table. We cache the organization name in the organization_name field for the contact

A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Importing indivs with orgs - current employer behavior
September 28, 2008, 11:48:19 am
As lobo mentioned its stored in organization_name. You should also have "contact_type='Individual'" in your WHERE clause :)

OR you can use

Quote
require_once 'CRM/Contact/BAO/Relationship.php';
$currentEmployer = CRM_Contact_BAO_Relationship::getCurrentEmployer( array( $contactId ) );

You need to pass array of contact ids for above function, and it will return corresponding current employer, if exits.

HTH

Kurund
« Last Edit: September 28, 2008, 11:52:55 am by Kurund Jalmi »
Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 2.1 Release Testing »
  • Importing indivs with orgs - current employer behavior

This forum was archived on 2017-11-26.