Files
upstream-mirror e7da97194a
Some checks failed
App Prod-Parity E2E Dispatch / dispatch (push) Failing after 10s
CD Storybook UI / build (push) Failing after 3m25s
CD Storybook UI / dispatch (push) Has been skipped
CD deploy main / website-changed-files (push) Successful in 18m8s
CI Agent Skills / changed-files-check (push) Successful in 18m9s
CI Create App E2E minimal / changed-files-check (push) Successful in 24s
CI Create App / changed-files-check (push) Successful in 26s
CI Docs / changed-files-check (push) Successful in 26s
CI Emails / changed-files-check (push) Successful in 28s
CI Example App Hello World / changed-files-check (push) Successful in 23s
CI Front / changed-files-check (push) Has been skipped
CI Example App Postcard / changed-files-check (push) Successful in 27s
CI UI / changed-files-check (push) Has been skipped
CI Utils Test / changed-files-check (push) Successful in 45s
CI Twenty Apps / discover (push) Successful in 1m3s
CD deploy main / deploy-main (push) Failing after 3s
CI Agent Skills / agent-skills-validate (push) Has been skipped
CI Create App / create-app-test (lint) (push) Has been skipped
CI Emails / emails-test (push) Has been skipped
CI Front / front-task (lingui:compile) (push) Has been skipped
CI Front / front-task (lint) (push) Has been skipped
CI Example App Postcard / example-app-postcard (push) Has been skipped
CI UI / ui-task (lint) (push) Has been skipped
CI UI / ui-task (pack-size) (push) Has been skipped
CI UI / ui-task (size) (push) Has been skipped
CI UI / ui-task (test) (push) Has been skipped
CI UI / ui-task (typecheck) (push) Has been skipped
CI Utils Test / utils-test (push) Has been skipped
CI Twenty Apps / ${{ matrix.app.name }} (push) Has been skipped
CI Emails / ci-emails-status-check (push) Successful in 2s
CI Example App Hello World / ci-example-app-hello-world-status-check (push) Successful in 2s
CI Example App Postcard / ci-example-app-postcard-status-check (push) Successful in 3s
CI UI / ui-sb-test (push) Has been skipped
CI Utils Test / ci-utils-test-status-check (push) Successful in 2s
CI Twenty Apps / ci-twenty-apps-status-check (push) Successful in 2s
CI UI / ci-ui-status-check (push) Successful in 2s
CI Desktop / desktop (push) Failing after 1m8s
Push docs to Crowdin / Push documentation to Crowdin (push) Failing after 55s
Push translations to Crowdin / Extract and upload translations (push) Failing after 5s
Push website translations to Crowdin / Extract and upload website translations (push) Failing after 5s
CI Create App / create-app-test (test) (push) Has been skipped
CI Create App / create-app-test (typecheck) (push) Has been skipped
CI Docs / docs-lint (push) Has been skipped
CI Example App Hello World / example-app-hello-world (push) Has been skipped
CI Front / front-task (lingui:extract) (push) Has been skipped
CI Front / front-task (test) (push) Has been skipped
CI Front / front-task (typecheck) (push) Has been skipped
CI UI / ui-sb-build (push) Failing after 1m32s
CI Twenty Apps / ${{ matrix.app.name }} (${{ matrix.server-source }}) (push) Has been skipped
CI Agent Skills / agent-skills-publish (push) Has been skipped
CI Create App / ci-create-app-status-check (push) Successful in 2s
CI Agent Skills / agent-skills-remote-source (push) Has been skipped
CI Create App E2E minimal / create-app-e2e-minimal (push) Has been cancelled
CI E2E Main / e2e-test (push) Has been cancelled
CI Front / front-sb-build (push) Has been cancelled
CI Front / front-build (push) Has been cancelled
CI Create App E2E minimal / ci-create-app-e2e-minimal-status-check (push) Has been cancelled
CI E2E Main / ci-e2e-main-status-check (push) Has been cancelled
CI E2E Main / notify-main-ci-failure (push) Has been cancelled
CI E2E Main / qa-scout-comment (push) Has been cancelled
CI Front / front-sb-test (push) Has been cancelled
CI Front / front-sb-screenshots (push) Has been cancelled
CI Front / ci-front-status-check (push) Has been cancelled
DPA Sub-Processor Sync / sync-subprocessors (push) Failing after 3s
AI Catalog Sync / sync-catalog (push) Failing after 2s
snapshot of https://github.com/twentyhq/twenty.git (main, 2026-09-17; blobs > 131072B omitted)
2026-09-17 23:28:13 +05:00

71 lines
2.0 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: 创建关系字段
description: 通过关系字段逐步将对象连接起来。
---
关系字段可连接不同对象的记录——例如,将人员链接到公司。
<Note>
**关系名称在创建后无法更改**(它们会影响 API)。 请谨慎规划名称。
</Note>
## 开始之前
请确定:
* 要连接哪些对象? (例如,人员 → 公司)
* 哪一方是“一”端? (例如,公司)
* 哪一方是“多”端? (例如,人员—许多人在同一家公司工作)
* 两端的字段应如何命名?
请参阅[关系字段](/l/zh/user-guide/data-model/capabilities/relation-fields),了解关系类型的说明。
## 步骤
1. 进入 **设置 → 数据模型**
2. 选择要创建关系的对象(通常为“多”端)
3. 点击 **+ 新建字段**
4. 将字段类型选择为 **关系**
5. 选择**目标对象**
6. 选择 **一对多** 或 **多对一**
7. 为关系的**两端**输入字段名称
8. 单击 **保存**
## 示例:人员 → 公司
* 进入 **设置 → 数据模型 → 人员**
* 添加关系字段
* 目标:**公司**
* 类型:**多对一**
* 人员中的字段:**公司**
* 公司中的字段:**员工**
现在,每个人员都可以关联到一家公司,每家公司都会显示其人员。
## 停用关系
1. 进入 **设置 → 数据模型 → 所选对象**
2. 找到该关系字段并点击它
3. 点击 **停用** 按钮
关联会被保留但隐藏。 重新启用即可恢复。
<Note>
**停用关系不会删除记录。** 只会移除它们之间的关联。
</Note>
## 删除关系
1. 进入 **设置 → 数据模型 → 所选对象**
2. 找到该关系字段并点击它
3. 点击 **删除** 按钮
<Note>
仅适用于自定义关系。 标准关系只能被停用。
</Note>
## 相关内容
* [关系字段](/l/zh/user-guide/data-model/capabilities/relation-fields) — 类型和限制
* [如何导入关系](/l/zh/user-guide/data-migration/how-tos/import-relations-between-objects-via-csv) — 批量导入关联记录