Most real plugin work is a variation on a small number of patterns. This chapter is a reference: real scenarios developers build plugins for, grouped by category, with the message and stage each typically uses.

Data integrity

ScenarioTypical message / stage
Prevent deletion under a condition (e.g. a Won Opportunity)Pre-validation, Delete
Real-time field validation too complex for a Business RulePre-validation, Create/Update
Custom duplicate detection beyond the built-in rulesPre-validation, Create
Dependency checking before allowing a deletePre-validation, Delete
Example A plugin blocks deleting an Account if it still has open Opportunities: pre-validation on Delete, query for related open records, throw InvalidPluginExecutionException if any are found — nothing is removed before the check runs.

Automation & notifications

ScenarioTypical message / stage
Cascade updates to related records (e.g. an address change flowing to Contacts)Post-operation, Update
Automatic record assignment by territory or workloadPost-operation, Create
Status-change notification when a record crosses a thresholdPost-operation (async), Update
Calculated fields derived from other fieldsPre-operation, Create/Update
Auto task creation after an event (e.g. a new Case)Post-operation, Create
Example A high-value Opportunity moving to "Negotiation" triggers an async post-operation plugin that emails the sales manager — not time-critical, so it runs after the rep's save has already completed.

Auditing & escalation

ScenarioTypical message / stage
Custom audit/history logging on specific field changesPost-operation, Update
SLA-style escalation when a time-based threshold is at riskOften paired with a scheduled/async job

Integration

ScenarioTypical message / stage
Calling an external system when a record changes (e.g. posting an order)Async post-operation, Create/Update
Example When an Order is confirmed, an async plugin posts the order details to an external fulfillment API. Running async means a slow or briefly unavailable external system doesn't hold up the user's save.
Key takeaway: Almost every plugin you'll build fits one of these patterns — blocking or validating something (pre-validation), reacting after a save (post-operation), or handing off to something slower (async). Recognizing the pattern usually tells you the stage and mode before you write a line of code.