dataverse-plugins

Installation
SKILL.md

Dataverse Plugins

CRITICAL RULES

  1. MOST DANGEROUS: Never use instance fields for per-request state. Plugin instances are cached by the platform and reused across requests. Multiple concurrent requests execute on the SAME instance simultaneously. Storing this._context, this._orgService, or any per-request data in instance fields causes race conditions and data corruption — intermittent, hard to reproduce, and catastrophic. All per-request state MUST be local variables inside Execute(). The constructor runs once (or after step registration changes) — not per request.

  2. Swallowing OrganizationServiceFault silently breaks the transaction. Any catch-and-continue after an org service call failure leaves the transaction in an invalid state. The next service call throws a misleading error that appears to originate from an entirely different plugin, making root cause analysis extremely difficult. Always rethrow as InvalidPluginExecutionException.

  3. Set HTTP timeout explicitly — default is 100 seconds. Without HttpClient.Timeout, a stuck external call can consume the entire 2-minute operation budget. Set timeout ≤ 15 seconds. Also set connection.KeepAlive = false and force sync execution with .GetAwaiter().GetResult() — await causes deadlocks in .NET 4.6.2 plugin context.

  4. Secure Configuration is NOT exported with solutions. SecureConfig values are stripped on export. They must be manually re-entered in every target environment after import. The #1 source of "works in dev, silent failure in prod" with configured plugins. Document all required Secure Config values in your solution README.

  5. Always specify filtering attributes on Update registrations. A plugin on Update with no filtering attributes fires for every field change on every Update call — including automated system updates. In high-volume environments this multiplies execution count dramatically. Register only for the specific columns your logic reads.

  6. Throw InvalidPluginExecutionException for all user-facing errors. Any other exception surfaces as IsvUnExpected and exposes the raw stack trace and exception type to users. Wrap at the top of Execute(): always catch, always rethrow as InvalidPluginExecutionException.

  7. PreValidation runs BEFORE security checks. Your plugin executes for users who may not yet have been authorized. Doing work (logging, reads, external calls) in PreValidation means unauthorized users trigger that work before the platform rejects them.

  8. Async PostOperation plugins fire in parallel. Multiple async plugins on the same message all start simultaneously. If they all update the same related record, concurrent update conflicts occur intermittently. Use queue-based patterns or a single async plugin that coordinates work when multiple handlers touch the same parent records.

Installs
1
GitHub Stars
4
First Seen
Jul 7, 2026