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.
Where to find it
- Module: Platform
- Group: Automation
- Section: Extension Hooks
- Screen: Extension Hooks
Address in the console: /platform/extension-hooks
List · 11 columns · 15 fields on its form · 4 of them required · 4 actions
What the list shows
These are the columns of the list, in the order they are drawn. Any of them can be sorted on, filtered on, hidden, or exported.
| Column | Kind | Field name |
|---|---|---|
| Hook | Text | name |
| Point | Status | point |
| Module | Code | module_key |
| Screen | Code | resource_key |
| Does | Status | action_kind |
| Mode | Status | mode |
| Runs | Number | run_count |
| Refused | Number | veto_count |
| Errors | Number | error_count |
| On | Yes or no | is_active |
| Last problem | Text | last_error |
The form
What is asked for when a record is created here. Required fields are marked; a choice drawn from a configuration list is one an administrator can extend without a release.
| Field | Type | Choices | Notes |
|---|---|---|---|
| Name required | Text | A name people will recognise in the run log. | |
| What it is for | Long text | Why this rule exists. | |
| Point required | Choice | 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. |
| Screen required | Choice | Looked up from existing records | 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). |
| Does required | Choice | 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. |
| Condition | Long text | 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. | |
| Message | Text | What a person is told. {field} is replaced by the record's value. | |
| Message (as an expression) | Text | Optional: work the message out, e.g. concat("Over budget by ", total - 10000). | |
| Only when moving to | Text | For the status points: comma-separated statuses; empty means any move. | |
| Webhook | Choice | Looked up from existing records | One of this company's outbound webhooks. It signs and screens the target like every delivery. |
| What is sent | Text | A set of named expressions, e.g. {"number": "record_no", "total": "total"}. Empty sends the record without personal or secret fields. | |
| Order | Number | Hooks at the same point run in this order. | |
| Time budget (ms) | Number | 10 to 500. A run over it is skipped and counted as an error. | |
| Runs per minute | Number | A ceiling for warnings, sends and log lines (a refusal is never throttled). | |
| On | Yes or no | A hook that fails ten runs in a row is switched off with the reason; switch it on again after fixing it. |
What you can do here
Test primary
Try this hook without running it
Asks for: Sample record (JSON) Or a real record id
Switch live
Asks for confirmation: Switch this hook live? It will refuse, warn or send on real saves from now on.
Back to dry run
Asks for confirmation: Put this hook back in dry run? It stops acting at once and is only evaluated and logged.
Run log
The rules that apply here
Everything on this screen obeys the platform rules rather than rules of its own. The ones worth knowing before you use it:
- Narrowing a list — search, conditions, sort, totals, export and saved views.
- What may be changed — the five grounds a record may not be edited on.
- Companies and business units — what the switcher above this list is doing to it.
- Creating a record — required fields, where choices come from, and how the number is allocated.
- Importing a spreadsheet — this screen accepts one, and it runs through the same rules as typing.