Skip to main content
7 votes

Managing multiple CiviCRM relationships in a Drupal View: A case study for A->C plus B->C relationships

Here's my solution for achieving the three goals outlined in the question. I may edit this a bit as I find errors and where commenters declare confusion. First, the caveats. Second, some info about ...
Lewis's user avatar
  • 457
6 votes

Need to change membership inheritance

Just sharing that we have developed and released a CiviCRM extension which solves this problem, see https://github.com/agileware/au.com.agileware.membershiprelationshiptypeeditor Membership ...
Justin Freeman - Agileware's user avatar
6 votes
Accepted

Exporting relationships

Have you tried Reports > Contact Reports > Relationships? The contact IDs of both Contacts A and B are concatenated with the name in parenthesis, and you also have the option to add the contact ID for ...
Tamar Meir - Cividesk's user avatar
6 votes

How to enter relationship dates before 1997?

For CiviCRM 4.6+ go to Administer menu > Customize Data and Screens > Date Preferences. From there, change the Start Offset of SearchDate. I found this answer in Member since date before 1995 and ...
ñull's user avatar
  • 1,208
6 votes

Searching for someone not in a relationship

The 'Include/Exclude' search is very handy for situations like this: create a group of all contacts of interest create a group of those who DO meet some criteria use include/exclude to include group ...
Aidan's user avatar
  • 13.5k
6 votes

How can I keep track of a "role" in an organisation (eg. secretary) over time (1980-1995)

Welcome to CiviCRM StackExchange Daniel! The CiviCRM relationships functionality will work perfectly for your use case scenario - https://docs.civicrm.org/user/en/latest/organising-your-data/...
Anil's user avatar
  • 2,008
5 votes

How to create a Drupal View with multiple CiviCRM relationships?

This is an update to the answer given by petednz - fuzion. In my case I needed to create a view which showed a list of all employees of the organisation employing the currently logged in employee. In ...
Ben's user avatar
  • 946
5 votes

Presales / Functionality Question

from a quick read I would expect you to be able to get most of the way, if not the whole way, but using Activities (or possibly Cases) to store the data for referals, and use Drupal Webforms to ...
petednz - fuzion's user avatar
  • 28.4k
5 votes
Accepted

Custom dropdown for specific relationship type

You can create custom group of fields for a specific relationship with your custom relationship type filter. This custom field will only be visible when you select relationship type from the drop down ...
Pradeep Nayak's user avatar
5 votes
Accepted

At signup, auto assign organization:contact relationship based on email domain being the same

Thanks everyone! I solved it totally with CiviRules extension. I just used a combination of the built-in API explorer & the extension's documentation to figure out how to create my own Condition ...
VoRCeK's user avatar
  • 161
5 votes
Accepted

What is the best way to record the primary contact for an organisation?

Option 3 is the clear winner, because neither option 1 nor option 2 have a clear way of indicating which organization they're the primary contact of. As soon as someone is affiliated with two ...
Jon G - Megaphone Tech's user avatar
5 votes

Possible Bug? Foreign key constraint error on upgrade to 5.31.0 (populating civicrm_relationship_cache)

Further to Pradeep Nayak's reply, the ultimate cause of the problems I was having were missing foreign key constraints on the civicrm_relationship table leaving orphaned data when contacts were ...
fred2's user avatar
  • 403
5 votes
Accepted

How to modify Relationships column display?

Take a look at Coleman's searchkit & formbuilder video to see how to create a relationships display.
Aidan's user avatar
  • 13.5k
4 votes
Accepted

Contacts: can one organisation be a 'child' of another?

What I would do is: - configure a new contact type 'NHS Team' based on organization - cofigure a relationship type between organization and NHS team The standard relationship type 'Child of' only ...
ErikH - CiviCooP's user avatar
4 votes
Accepted

How do you import (custom) relationship fields?

From what I can tell this functionality is not available in core imports, which allow relationships to be imported as a side function (e.g. when importing contacts, you can specify relationships on ...
Laryn's user avatar
  • 8,268
4 votes

Batch Update the current relationship in CiviCRM

I used contact_id_a and contact_id_b and relationship_type id and set the is_active to 0 in csv file. But this extension gives me an error "Error with entity "create"! (Duplicate Relationship)". ...
jitendra - fuzion's user avatar
4 votes

Batch Update the current relationship in CiviCRM

Just answering the question in the comments about how to export the relationship_id. One way is to run a Civi relationship report from Reports | Create Reports from Templates and include the Rel ID ...
David Letham's user avatar
4 votes
Accepted

Possible Bug? Foreign key constraint error on upgrade to 5.31.0 (populating civicrm_relationship_cache)

Your system have orphan data in civicrm_relationship table. There are few rows in civicrm_relationship table that have contact id in column civicrm_relationship.contact_id_a or ...
Pradeep Nayak's user avatar
4 votes
Accepted

Using fields of referenced contacts in message

Welcome to SE CiviCRM, you can install Fuzion tokens extension. It provides lots of tokens for contacts like relationships, payments etc Details can be found here.
Pradeep Nayak's user avatar
4 votes
Accepted

Include a CiviCRM role into Drupal View (custom dashboard)

I'd start with a case relationships view. Filter by relationship type, and case type. Bring in the case details via a views relationship And bring in the two contacts (A and B, from the relationship) ...
Craig Almond's user avatar
  • 2,037
4 votes
Accepted

relationships no longer working as expected - data corruption?

Based on comments the relationship_cache table is incomplete. Since you've already rebuilt the triggers (missing triggers may have been the cause of it not getting populated), the cache just needs ...
Demerit's user avatar
  • 23.3k
4 votes

Why would related contact deletion keeps a Relationship active?

It looks like that changed when the contact summary "Relationships" tab was replaced with a SearchKit version. I've submitted this PR to fix it and hide deleted contacts from that tab.
Coleman's user avatar
  • 18.8k
3 votes

Can we use a Relationship between 2 contacts, once in either direction?

Doing some research on your find using svn blame and svn log on the old svn repo, this appears to have been implemented as part of https://issues.civicrm.org/jira/browse/CRM-58, and the key comment is ...
Demerit's user avatar
  • 23.3k
3 votes
Accepted

Relationship type id stored in the wrong custom group column?

civicrm_custom_group.extends_entity_column_value stores more than just a number. You can have a custom group that extends a relationship type, but it can also be an activity type or a contact (sub-)...
DaveFF's user avatar
  • 1,527
3 votes

Ajax Error when trying to view relationships tab

I had the same issue. CiviCRM 4.7/Drupal 7/IIS8 configuration. The Ajax call was generating a query longer than what the web server was configured to handle and behind the scenes the web server was ...
Jim Bennett's user avatar
3 votes
Accepted

How can I regenerate memberships shared by relationship?

I ran into a situation where the membership-type relationships were missing a relationship type, so I had to re-generate the related memberships. Instead of export/import, I used the CiviCRM API: $...
bgm's user avatar
  • 3,431
3 votes

Can not add both Individual and Organisation to case

I too had this problem. What worked for me is modifying the Contact Type A and Contact Type B to All Contacts in the Relationship section (administer---customise data and screens---relationship types) ...
Sohal Khatwani's user avatar
3 votes
Accepted

Relationship disabled by end date but still enabled?

The "Disable expired relationships" scheduled job should set the is_active field to 0 for relationships with a past end date. A bit of history: Civi has always treated both past and disabled ...
davejenx's user avatar
  • 2,365
3 votes

Conditional relationships?

Another approach worth considering is the use of custom fields on the Relationship. You can add a Custom Field for Proxy Shopper, on to the Household Member relationship, and if Willow lets you know ...
petednz - fuzion's user avatar
  • 28.4k
3 votes

Conditional relationships?

To handle this, you would have to write an extension. I would use hook_civicrm_pre on the Relationship entity (operation is "create", maybe "edit" too if households tend to shift?). Do two API calls ...
Jon G - Megaphone Tech's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible