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.
Où le trouver
- Module: Plate-forme
- Groupe: Automation
- Section: Extension Hooks
- Écran: Extension Hooks
Adresse dans la console: /platform/extension-hooks
Liste · 11 colonnes · 15 champs sur son formulaire · 4 d'entre eux requis · 4 actes
Ce que la liste affiche
Voici les colonnes de la liste, dans l'ordre où elles apparaissent. Chacune d'elles peut être triée, filtrée, masquée ou exportée.
| Colonne | Gentil | Nom du champ |
|---|---|---|
| Hook | Texte | name |
| Point | Statut | point |
| Module | Code | module_key |
| Écran | Code | resource_key |
| Fait | Statut | action_kind |
| Mode | Statut | mode |
| Courses | Nombre | run_count |
| Refusé | Nombre | veto_count |
| Erreurs | Nombre | error_count |
| Sur | Oui ou non | is_active |
| Last problem | Texte | last_error |
Le formulaire
Voici les informations demandées lors de la création d'un enregistrement. Les champs obligatoires sont indiqués ; un choix issu d'une liste de configuration est un choix qu'un administrateur peut compléter sans nouvelle version.
| Champ | Taper | Choix | Notes |
|---|---|---|---|
| Nom requis | Texte | A name people will recognise in the run log. | |
| À quoi ça sert | Texte long | Why this rule exists. | |
| Point requis | Choix | 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. |
| Écran requis | Choix | Consulté à partir des archives existantes | 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). |
| Fait requis | Choix | 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 | Texte long | 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 | Texte | What a person is told. {field} is replaced by the record's value. | |
| Message (as an expression) | Texte | Optional: work the message out, e.g. concat("Over budget by ", total - 10000). | |
| Only when moving to | Texte | For the status points: comma-separated statuses; empty means any move. | |
| Webhook | Choix | Consulté à partir des archives existantes | One of this company's outbound webhooks. It signs and screens the target like every delivery. |
| What is sent | Texte | A set of named expressions, e.g. {"number": "record_no", "total": "total"}. Empty sends the record without personal or secret fields. | |
| Commande | Nombre | Hooks at the same point run in this order. | |
| Time budget (ms) | Nombre | 10 to 500. A run over it is skipped and counted as an error. | |
| Runs per minute | Nombre | A ceiling for warnings, sends and log lines (a refusal is never throttled). | |
| Sur | Oui ou non | A hook that fails ten runs in a row is switched off with the reason; switch it on again after fixing it. |
Ce que vous pouvez faire ici
Test primaire
Try this hook without running it
Demande : Sample record (JSON) Or a real record id
Switch live
Demande confirmation : Switch this hook live? It will refuse, warn or send on real saves from now on.
Back to dry run
Demande confirmation : Put this hook back in dry run? It stops acting at once and is only evaluated and logged.
Run log
Les règles qui s'appliquent ici
Tout ce qui s'affiche à l'écran obéit aux règles de la plateforme et non à des règles propres. Voici celles qu'il est important de connaître avant de l'utiliser :
- Réduire une liste — Recherche, conditions, tri, totaux, exportation et vues enregistrées.
- Ce qui peut être changé — les cinq motifs pour lesquels un enregistrement ne peut être modifié.
- Entreprises et unités commerciales — ce que le commutateur situé au-dessus de cette liste lui fait.
- Création d'un enregistrement — champs obligatoires, provenance des choix et mode d'attribution des numéros.
- Importer une feuille de calcul — Cet écran en accepte un, et il suit les mêmes règles que la saisie au clavier.