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) »
  • Cannot add relationship to a new contact when the target is set up as a subtype
Pages: [1]

Author Topic: Cannot add relationship to a new contact when the target is set up as a subtype  (Read 817 times)

baergaj

  • I’m new here
  • *
  • Posts: 8
  • Karma: 1
  • CiviCRM version: 4.2
  • CMS version: Drupal 7.16
  • MySQL version: 5.5.27
  • PHP version: 5.3.17
Cannot add relationship to a new contact when the target is set up as a subtype
November 07, 2012, 09:54:44 am
Hi there,

I am implementing CiviCRM for a non-profit in Alberta, Canada. I have run into an issue and can reproduce it on the demo site. I have not been able to find any bug reports for the issue.

Steps to Reproduce:
1. Create a new subtype of Organization - "Church"
2. Create a new relationship where Contact Type A is Individual, Contact Type B is Church - "Attendee Of"
3. Add new relationship to an existing Individual
4. Choose "Attendee Of"
5. Choose to create new contact (the only option is to create a New Organization, this is probably the root of the issue as New Church should be the only option available)
6. Save the new contact
7. Click on Quick Save

Expected Result: "Attendee Of" relationship created to new "Church" contact

Actual Result: The relationship is not created, and the following error is displayed - "relationship record not created due to invalid target contact type."

Should I report a bug for this? Is there an open bug that I am not finding?

Thanks for your help!

Andrew

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Cannot add relationship to a new contact when the target is set up as a subtype
November 07, 2012, 10:47:58 am
This is more of a missing feature than a bug. Currently the inline 'new contact' widget doesn't support creating contact subtypes. It might not be too difficult to add support for this - allowing admins to create new profiles which would get included in the widget.  If you're interested in working on this, grab us on IRC.

Alternatively, if all the organizations you need to 'quick add' are Churches - you could try modifying the fields in the existing 'reserved profile' for New Organization. Change the Organization Name field to be Sponsor -> Organization Name and see if that works.
Protect your investment in CiviCRM by  becoming a Member!

baergaj

  • I’m new here
  • *
  • Posts: 8
  • Karma: 1
  • CiviCRM version: 4.2
  • CMS version: Drupal 7.16
  • MySQL version: 5.5.27
  • PHP version: 5.3.17
Re: Cannot add relationship to a new contact when the target is set up as a subtype
November 07, 2012, 12:49:33 pm
Thanks for getting back to me so quickly!

I think what I would actually like to do is customize the "Current Employer" field and "Employee of" relationship so that they are named "Current Church" and "Attendee of".

I see that I can change the labels of the "Employee of" relationship easily so no problems there.

Is there a way to change the "Current Employer" field label easily? in a way that will survive an upgrade?

Thanks again!

Andrew

baergaj

  • I’m new here
  • *
  • Posts: 8
  • Karma: 1
  • CiviCRM version: 4.2
  • CMS version: Drupal 7.16
  • MySQL version: 5.5.27
  • PHP version: 5.3.17
Re: Cannot add relationship to a new contact when the target is set up as a subtype
November 07, 2012, 12:56:02 pm
Looks like I can use Word Replacements to accomplish what I want - Employer => Church - so I think I have a solution!

I may be interested in working on implementing the "inline 'new contact' widget does not support creating contact subtypes" feature/bug fix. Thanks for the invite.

Andrew

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Cannot add relationship to a new contact when the target is set up as a subtype
November 07, 2012, 09:55:39 pm
A related feature that you may or may not want to try to tackle at the same time:
When importing with a relationship, and that relationship is to a contact subtype, any new records created should be of that contact subtype.

Example:  Jane Doe is an attendee of Church X (assuming "Church" is a contact subtype).  When you import Jane Doe, Church X's record is created if it doesn't exist...but is created as an organization, not a church.

IIRC, it's even possible to change the contact type to something totally impossible by importing with a relationship, but I don't have that sufficiently well documented at the moment.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Cannot add relationship to a new contact when the target is set up as a subtype

This forum was archived on 2017-11-26.