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. | |
| ويب هوك | خيار | تم البحث عنها من السجلات الموجودة | 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
القواعد التي تنطبق هنا
كل ما يظهر على هذه الشاشة يخضع لقواعد المنصة وليس لقواعد خاصة بها. إليك أهم ما يجب معرفته قبل استخدامها:
- تضييق نطاق القائمة — البحث، والشروط، والفرز، والمجاميع، والتصدير، والعروض المحفوظة.
- ما الذي يمكن تغييره — الأسباب الخمسة التي لا يجوز بموجبها تعديل السجل.
- الشركات ووحدات الأعمال — ما يفعله المحول الموجود أعلى هذه القائمة بها.
- إنشاء سجل — الحقول المطلوبة، ومصدر الخيارات، وكيفية تخصيص الرقم.
- استيراد جدول بيانات — تقبل هذه الشاشة إدخالاً واحداً، وتخضع لنفس قواعد الكتابة.