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.
Onde encontrar
- Módulo: Plataforma
- Grupo: Automação
- Seção: Extension Hooks
- Tela: Extension Hooks
Endereço no console: /platform/extension-hooks
Lista · 11 colunas · 15 campos em seu formulário · 4 deles exigido · 4 ações
O que a lista mostra
Estas são as colunas da lista, na ordem em que são exibidas. Qualquer uma delas pode ser usada para ordenar, filtrar, ocultar ou exportar.
| Coluna | Tipo | Nome do campo |
|---|---|---|
| Hook | Texto | name |
| Point | Status | point |
| Módulo | Código | module_key |
| Tela | Código | resource_key |
| Faz | Status | action_kind |
| Modo | Status | mode |
| Corridas | Número | run_count |
| Recusado | Número | veto_count |
| Erros | Número | error_count |
| Sobre | Sim ou não? | is_active |
| Last problem | Texto | last_error |
O formulário
O que é solicitado aqui quando um registro é criado. Os campos obrigatórios estão marcados; uma opção selecionada de uma lista de configuração é uma que um administrador pode estender sem uma nova autorização.
| Campo | Tipo | Escolhas | Notas |
|---|---|---|---|
| Nome obrigatório | Texto | A name people will recognise in the run log. | |
| Para que serve? | Texto longo | Why this rule exists. | |
| Point obrigatório | Escolha | 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. |
| Tela obrigatório | Escolha | Consultado em registros existentes | 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). |
| Faz obrigatório | Escolha | 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. |
| Doença | Texto longo | 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. | |
| Mensagem | Texto | What a person is told. {field} is replaced by the record's value. | |
| Message (as an expression) | Texto | Optional: work the message out, e.g. concat("Over budget by ", total - 10000). | |
| Only when moving to | Texto | For the status points: comma-separated statuses; empty means any move. | |
| Webhook | Escolha | Consultado em registros existentes | One of this company's outbound webhooks. It signs and screens the target like every delivery. |
| What is sent | Texto | A set of named expressions, e.g. {"number": "record_no", "total": "total"}. Empty sends the record without personal or secret fields. | |
| Ordem | Número | Hooks at the same point run in this order. | |
| Time budget (ms) | Número | 10 to 500. A run over it is skipped and counted as an error. | |
| Runs per minute | Número | A ceiling for warnings, sends and log lines (a refusal is never throttled). | |
| Sobre | Sim ou não? | A hook that fails ten runs in a row is switched off with the reason; switch it on again after fixing it. |
O que você pode fazer aqui
Teste primário
Try this hook without running it
Solicita: Sample record (JSON) Or a real record id
Switch live
Solicita confirmação: Switch this hook live? It will refuse, warn or send on real saves from now on.
Back to dry run
Solicita confirmação: Put this hook back in dry run? It stops acting at once and is only evaluated and logged.
Run log
As regras que se aplicam aqui
Tudo nesta tela obedece às regras da plataforma, e não a regras próprias. Algumas informações importantes que você precisa saber antes de usar:
- Reduzindo uma lista — Pesquisa, condições, ordenação, totais, exportação e visualizações salvas.
- O que pode ser alterado — Os cinco motivos pelos quais um registro não pode ser editado.
- Empresas e unidades de negócios — O que o seletor acima desta lista está fazendo com ele.
- Criar um registro — campos obrigatórios, de onde vêm as opções e como o número é alocado.
- Importar uma planilha — Esta tela aceita um, e funciona das mesmas regras que a digitação.