One of the most common questions that comes up while developing Plugins in Dynamics 365 CRM: should I use Synchronous or Asynchronous? 🤔
The answer depends on the nature of the operation you’re implementing.
- 🔹 Synchronous Plugin (Sync): the Plugin runs at the exact moment the operation is executed, and the user waits until the Plugin finishes.
Used for: Validation before saving, modifying data before or after saving, preventing a record from being created or updated if a certain condition is met, any operation that must complete before the user continues.
Example: when creating a Contact: making sure the Emirates ID number isn’t duplicated. If the number already exists, you block the record from being created and show the user a message. In this case you must use a Synchronous Plugin because the user needs to know about the error immediately.
- 🔹 Asynchronous Plugin (Async): the Plugin runs in the background after the operation finishes, so the user doesn’t have to wait.
Used for: sending an Email, calling an external API, integrating with another system, generating files or reports, any operation that could take time.
Example: after a Case is created: sending the Case data to an external system (ERP, VMS, or SSP).
Bottom line: use Synchronous when the operation is Validation, needs an immediate result, or can’t tolerate stale data. Use Asynchronous when the operation is long-running, an external integration, or doesn’t need to block the user. Choosing the right type helps improve Performance, User Experience, and System Stability.