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 Import (Moderator: Yashodha Chaku) »
  • Import update relationships change contact type from household to indviduals
Pages: [1]

Author Topic: Import update relationships change contact type from household to indviduals  (Read 398 times)

questions

  • I post occasionally
  • **
  • Posts: 79
  • Karma: 2
  • CiviCRM version: 4.4.6
  • CMS version: Durpal, 7
  • MySQL version: 5.1
  • PHP version: 5.3
Import update relationships change contact type from household to indviduals
September 25, 2014, 10:48:25 am
I've come across this issue with updating relationships with older versions, 3.2.3, 3.5.7 and now with 4.4.6.  There was a bug against 4.4.5 for similar type issue but alas it didn't fix this issue.

Import update to create relationship between individuals and households or individuals, results in the hh being changed to ind.

More explicit:
 
So if you have a cvs of a bunch of kids and you are linking them to their parents some of whom are households and some are individuals, the cvs would just need two contact_id's,  one for the kid and one for the parent.  With the import you pick update and individuals since you are driving the import by the kids id.  Select contact_id for the kid id and child of and then contact_id for the parent's  id.  All the the HH will be converted individuals.

I haven't tried the reverse but I'm willing to bet it changes ind into HH

It is easy to fix them

sql to see HH that have become ind

select household_name,
       first_name,
       last_name
from   civicrm_contact
where  contact_type = "Individual"
and    household_name is not null

sql to update them

update civicrm_contact
set    contact_type = "Household"
where  contact_type = "Individual"
and    household_name is not null

BTW, one can not create the relationship on initial import of one side of the relationship.  You get an error which isn't completely obvious as to what the issue is.  I'm guessing it needs to do two passes, one for creating the relationship for the one party and one for the other, and in a dry run it sees the one party doesn't exist yet so it errors.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Import update relationships change contact type from household to indviduals

This forum was archived on 2017-11-26.