---
title: Custom object relationships | Lightfield
description: Connect records through typed relationships and group their links.
---

A relationship connects two object types so their records can be linked. For example, link a Campaign to the accounts it targets, or a Vendor to the contacts who manage it. Linked records show on both sides: open the campaign to see its accounts, or open an account to see its campaigns.

A relationship can connect two custom objects, a custom object and a built-in object (accounts, contacts or opportunities), or a custom object and itself.

## Who can use it

Relationships are part of [custom objects](/help/custom-objects/index.md), which are on every plan. Owners and admins create, rename and archive relationships.

Anyone who can edit a record can add or remove its links. To link it to another record, you need edit access to that record too.

## Choose a relationship type

| Type             | Use it when                                                       | Example                                                               |
| ---------------- | ----------------------------------------------------------------- | --------------------------------------------------------------------- |
| **One to one**   | Each record on each side links to exactly one record on the other | Each Property has one Listing agreement                               |
| **One to many**  | A parent has many children, and each child has one parent         | Sub-campaigns under a campaign                                        |
| **Many to many** | Records on both sides link to any number of records on the other  | A Campaign targets many accounts, and an account is in many campaigns |

You cannot change the type after creating the relationship. Choose **One to many** when each child has one parent, and **Many to many** when records on either side can have several links. Confirm the relationship you need before creating it.

### How one to many looks on records

To build a hierarchy within one object, point the object at itself. A Campaign to Campaign relationship gives you parent campaigns with sub-campaigns.

- **Parent record:** shows a list of its children, such as “Sub-campaigns”. Add or remove children here.
- **Child record:** shows its one parent, such as “Parent campaign”. Pick or change it here.

A child has one parent at a time, so assigning a new parent removes the old one. A record can’t become its own ancestor, and hierarchies have a depth limit. Lightfield tells you when a change would break either rule.

## Create a relationship

1. Go to [Settings → Data model](https://crm.lightfield.app/crm/settings/data-model/) and open the object to link from, such as `Campaign`.
2. Open the **Relationships** tab and select **Create relationship**.
3. Choose the **Related object**. To build a hierarchy, choose the same object.
4. Choose the **Relationship type**. The helper text below it explains how records will connect.
5. Enter the label on each side: **Label on \[this object]**, such as `Target accounts`, and **Label on \[related object]**, such as `Campaigns`.
6. Select **Create**.

The relationship appears on the Relationships tab and as a section on both objects’ records.

You can create more than one relationship between the same two objects, each with its own labels, such as Advisors and Vendors between Campaign and Contact.

Or ask the agent in chat, for example “Link Campaigns to Accounts” or “Create a parent and child relationship between Programs and Projects.” The agent shows the type, labels and any group before anything changes.

## Group relationships

A group collects several many-to-many relationships under one heading on a record. For example, a Campaign’s “Agency partners” group can hold two relationships to Contacts, Advisors and Vendors, so the campaign shows one section with how each contact is involved.

1. On the object’s **Relationships** tab, select **Create group**.
2. Enter the **Group name on source**, such as `Agency partners`.
3. Choose the **Related object** every relationship in the group links to, such as Contacts.
4. Enter the **Group name on target**: how the group appears on the related object’s records.
5. Select **Create**.
6. Select **Add relationship** inside the group, enter a **Name** such as `Advisors`, and select **Create**. Repeat for each relationship in the group.

Open a record to check that the relationships appear under the group heading.

## Rename, archive and restore

- **Rename:** edit a relationship’s labels on either side at any time. To rename a group, hover over it on the Relationships tab and choose the rename option.
- **Archive:** on the source object’s **Relationships** tab, open the relationship’s **…** menu, select **Archive relationship**, and confirm. It disappears from both objects’ records. Archiving a group archives every relationship in it.
- **Restore:** find it under **Archived relationships** at the bottom of the source object’s Relationships tab, open its **…** menu and select **Restore**. Restore a group’s relationships one by one; there’s no way to restore a whole group at once.

The related object and relationship type are permanent. To change either, archive the relationship and create a new one.

## Common questions

**Can I archive the built-in relationships, such as Notes, Tasks, Files, Lists or the owner?** No. Lightfield manages those relationships, and they can’t be archived.

**Can a record link to itself?** No, not as its own parent or ancestor. In a many-to-many relationship on one object, different records of that object can link to each other.

**Is there a limit on how many links I can change at once?** Yes. One create or update of a record can change up to 25 links. For bigger changes, save in smaller batches.
