Extension Hooks
Rules attached to named points in a record's life: before or after it is saved, posted or approved, and when its status changes. A hook is a condition (the same expression language as custom rules) and one action: refuse with a message, warn, send on one of this company's webhooks, or write a log line. A hook cannot change a record or run code. New hooks start in dry run: evaluated and logged, never acting, until you switch them live. To fill in, work out, check, show or lock a field, use Custom Logic instead.
在哪里可以找到它
- 模块: 平台
- 团体: 自动化
- 部分: Extension Hooks
- 屏幕: Extension Hooks
控制台中的地址: /platform/extension-hooks
列表 · 11 列 · 15 表单上的字段 · 4 其中需要 · 4 行动
列表显示的内容
这些是列表的列,按绘制顺序排列。可以对任何列进行排序、筛选、隐藏或导出。
| 柱子 | 种类 | 字段名称 |
|---|---|---|
| Hook | 文本 | name |
| Point | 地位 | point |
| 模块 | 代码 | module_key |
| 屏幕 | 代码 | resource_key |
| 做 | 地位 | action_kind |
| 模式 | 地位 | mode |
| 跑 | 数字 | run_count |
| 拒绝 | 数字 | veto_count |
| 错误 | 数字 | error_count |
| 在 | 是还是不是 | is_active |
| Last problem | 文本 | last_error |
表格
此处会显示创建记录时需要填写的信息。必填字段已标记;管理员可以从配置列表中选择所需选项,而无需发布新版本。
| 场地 | 类型 | 选择 | 笔记 |
|---|---|---|---|
| 姓名 必需的 | 文本 | A name people will recognise in the run log. | |
| 它的用途是什么 | 长文本 | Why this rule exists. | |
| Point 必需的 | 选择 | Before a record is saved, After a record is saved, Before a document is posted, After a document is posted, Before an approval is given, After an approval is given, Before the status changes, After the status changed | When in the record's life the hook runs. |
| 屏幕 必需的 | 选择 | 从现有记录中查找 | The screen whose records the hook watches, e.g. CRM › Accounts, or a custom object. "Every screen" covers the whole module (not for a hook that refuses). |
| 做 必需的 | 选择 | Refuse with a message (before points only), Warn but allow (before points only), Send on a webhook (after points only), Only write it in the run log | Only a before hook can refuse or warn; only an after hook can send. |
| 健康)状况 | 长文本 | When the hook acts, e.g. total > 10000 and is_empty(project_code). Empty means always. You may use record fields, previous, changed, status, to_status, user and today. | |
| 信息 | 文本 | What a person is told. {field} is replaced by the record's value. | |
| Message (as an expression) | 文本 | Optional: work the message out, e.g. concat("Over budget by ", total - 10000). | |
| Only when moving to | 文本 | For the status points: comma-separated statuses; empty means any move. | |
| Webhook | 选择 | 从现有记录中查找 | One of this company's outbound webhooks. It signs and screens the target like every delivery. |
| What is sent | 文本 | A set of named expressions, e.g. {"number": "record_no", "total": "total"}. Empty sends the record without personal or secret fields. | |
| 命令 | 数字 | Hooks at the same point run in this order. | |
| Time budget (ms) | 数字 | 10 to 500. A run over it is skipped and counted as an error. | |
| Runs per minute | 数字 | A ceiling for warnings, sends and log lines (a refusal is never throttled). | |
| 在 | 是还是不是 | A hook that fails ten runs in a row is switched off with the reason; switch it on again after fixing it. |
你可以在这里做什么
测试 基本的
Try this hook without running it
请求: Sample record (JSON) Or a real record id
Switch live
请求确认: Switch this hook live? It will refuse, warn or send on real saves from now on.
Back to dry run
请求确认: Put this hook back in dry run? It stops acting at once and is only evaluated and logged.
Run log
这里适用的规则
此屏幕上的所有内容均遵循平台规则,而非其自身规则。使用前,您需要了解以下规则:
- 缩小列表范围 — 搜索、条件、排序、总计、导出和已保存的视图。
- 可能的变化 — 记录不得修改的五种情况。
- 公司和业务部门 — 列表上方的切换器对它做了什么。
- 创建记录 — 必填字段、选项来源以及数量分配方式。
- 导入电子表格 — 此屏幕接受一个输入,并遵循与打字相同的规则。