Adding a time-limited relationship
Relationships are a central feature of CiviCRM. For example, you may run an organization that has contacts related to it because they are volunteers, or you may have individual contacts that are the children of other contacts who are their parents. Some relationships are time-limited. For example, the chair of an organization may have a one year fixed term of office.
How to do it…
In this recipe we will set up a time-limited relationship between two contacts using the following steps:
- Navigate to Administer | Customize Data and Screens | Relationship Types and click on Add relationship:
- Set Relationship Label-A to B to
Chair
. - Set Relationship Label-B to A to
Chair is
. - Set Contact Type A to Individual.
- Set Contact Type B to Organization.
- Set a suitable description in the Description field.
- Check if the relationship is enabled.
- Save the relationship.
- Navigate to an individual contact, click on the Relationship tab, and add the relationship.
- Select the relationship type Chair and select the contact to relate to. CiviCRM autocompletes your entry from the organizations available in the database.
- Enter a start date and an end date for the relationship and add a description.
- Navigate to Administer | System Settings | Scheduled Jobs and enable and set the Disable Expired Relationships job.
How it works…
Contact Type A is set to Individual. Contact Type B is set to Organization. This means that only individuals can be chairs of organizations.
The Disable Expired Relationship job checks the dates on relationships and disables them if they have expired. This requires cron in order to function properly.
There's more…
You can allow the two related contacts to be able to view and edit each other's records by using the checkboxes below the Notes field. For example, you could allow the chair to be able to edit the organization record. This would also require the individual contact to have an active account on your CMS and permission to access their CiviCRM contact dashboard.
Note
Relationships become available for use in CiviCRM core functions such as importing, exporting, and searching data. They are also used in creating membership types.
See also
- The Setting up cron using cPanel recipe in Chapter 1, Setting Up CiviCRM
- Find more about CiviCRM relationships at http://book.civicrm.org/user/current/organising-your-data/relationships/