Xrm Tools now generates code-behind for plugins on any message
Xrm Tools v1.5.7 brings message-aware code generation for Dataverse plugins. Your code-behind now adapts to any message—Create, Delete, Merge, or Custom APIs—generating the right input properties automatically. Less SDK plumbing, more real logic.
Xrm Tools makes building plugins and Custom APIs for Power Platform incredibly smooth by making your code aware of Dataverse metadata — so you don’t have to constantly switch between Power Platform and Visual Studio.
You just write your business logic. IntelliSense does the heavy lifting. When you’re ready, hit Register Plugins and everything is handled for you.
But it goes even further.
Xrm Tools generates code-behind for your plugins, giving you things like:
- Early-bound Target
- Dependency injection
- Boilerplate SDK handling
Until now, however, code generation was limited to Create and Update messages.
🚀 Code Generation for Any Plugin Message
Starting with version 1.5.7, Xrm Tools generates code-behind for plugins registered on any Dataverse message.
🎥 You can see it in action here:
The generated code adapts as you write your plugin. It supports dependency injection and even detects when your plugin inherits from a base class — adjusting the generated code accordingly.
What Changes?
Previously, Xrm Tools always generated an early-bound Target property, no matter which message your plugin was registered on. That worked great for Create and Update. But what about Delete, Merge, Assign, or Custom APIs?
In those cases, you had to fall back to manually reading from ExecutionContext.InputParameters — just like in traditional plugins.
Not anymore!
Starting from v1.5.7, generated properties now depend on the actual message your plugin is registered on.
- If the message has a single input (like Target), you get a strongly typed property.
- If the message has multiple inputs, Xrm Tools generates a static class like:
public static class MergeInputParameters
{
public static EntityReference Target { ... }
public static Guid SubordinateId { ... }
public static MergeAccountEntity? UpdateContent { ... }
public static bool PerformParentingChecks { ... }
[EntityLogicalName("account")]
public class MergeAccountEntity : Entity
{
...
}
}This class contains all the message’s input parameters. That means when you type InputParameters. You get full IntelliSense for all valid inputs of your plugin message — no guesswork, no SDK documentation hunting.
🎥 Watch how changing the plugin message and saving instantly updates the generated code:
Update Now
Make sure to update to Xrm Tools v1.5.7 to start using message-aware code generation.
If you’re enjoying Xrm Tools:
- Leave a 5-star rating on the Visual Studio Marketplace ⭐⭐⭐⭐⭐
- Star the GitHub repository ⭐
Your support helps more developers discover the tool ❤️