Creating Your First Relationship

Last updated on
23 July 2018

Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites

CRM Core stores relationships between contacts via the relations module. There is always a subject -> object relationship enforced between participants in a relationship.

Unlike other modules for storing relationships in Drupal, it is assumed that relationships are expressly defined by a site operator, and that no acceptance is required to create the relationship. This means CRM Core assumes that someone is actively managing relationships in their system, and no one needs to accept a relationship request in order for it to be created. This is not a Facebook 'friends' style system, this is a storage engine for recording the details of relationships. Other modules can implement additional rules for how users can manage their own relationship information and integrate the stored data with CRM Core in order to present it.

In order to create a relationship, there needs to be at least 2 contacts being tracked by CRM Core. For the purposes of this exercise, go back to the contacts page, click the link to add a contact, and create a second individual in your site.

Working from the contact detail page, we are going to create a relationship. Click on the relationships tab at the top of any contacts page, and you will be presented with a screen for managing relationships around a contact. This screen is designed to track active relationships, inactive relationships, and to allow users to filter relationships by type.

To give you some more insights about what you are seeing on this page: in a CRM system, it can be important to understand what relationships are active and currently exist versus those that are no longer active. For instance, a contact may work for an organization currently, or may have worked for an organization at some point in the past. You might not want to delete a relationship when it is no longer active, because having a record that this relationship did exist at some point can be valuable to know.

By default, CRM Core allows you to track relationships depending on whether or not they are active, and it is possible to configure the system to track relationships based on other factors as well. Site builders will notice the screen for displaying relationships is a view, which can be configured in whatever manner you choose. This makes the relationships interface a pretty powerful tool for organizations that need to track relationships in unique and sophisticated ways.

For now, let's create a new relationship. Click the link to Add a Relationship that appears at the bottom of the page. You will be presented with a list of relationship types that are available in the system. CRM Core provides a set of predefined relationships that ship with the system, including friends, employees, and households. Each relationship type has some specific constraints on how it can be used relative to the type of contact being tracked. For instance:

  • Friend relationships can only be created between individuals.
  • Employee relationships can only be created between individuals and organizations.
  • Member relationships can only be created between individuals and households.

The details for how contacts can be related to other contacts can be managed within the CRM Core administrative interface. For instance, if you wanted to allow individuals to be friends with organizations as well as other individuals, you can configure the system to allow these kinds of relationships to be entered. This handbook will get into the details of administering relationships in another section.

For now, let's create a new relationship between the two contacts in our system. Click on the link for Friend Of to record the details of the friendship between the 2 contacts in our system.

The resulting page will display some information about the relationship to be stored in the system. You will notice some things about this screen:

  • There are fields for source and destination. CRM Core supports directional relationships, which can be enabled for each relationship type.
  • The fields for contact names are autocomplete fields. You can get a list of names for populating relationships just by typing a few keys. Names are looked up using the entire name field - it is fine if you want to start by typing a first name and a few letters of the last name.
  • There is a field for tracking status. Uncheck the box labelled Active whenever you want to store an inactive relationship.

The field for source contact name should be populated with the name of the selected contact. Go to the Destination Contact Name field and type some letters from the name of the other contact you created in the system. That name should pop up as an option, select it and the field will be populated with the correct information. Click the Save relationship button.

After saving a relationship, you will be taken back to the Relationships screen for the selected contact. A list of relationship records will appear, indicating the nature of the relationship, the status of the relationship, and providing some controls for managing the relationship. A relationship can be marked inactive from this screen or deleted entirely. Again, this page is a view - if the default display of relationships does not suit you, administrators can configure the view to display whatever way they want.

Help improve this page

Page status: No known problems

You can: