enabling xrm tools for old plugins - rezanid/xrmtools GitHub Wiki
You don't have to write plugins from scratch to enable features like code-generation or qucik registration. By adding registration attributes like [Plugin], [Step], [Image] and [CustomApi] to any plugin you can enable these features. However, it can be tedious to add these attributes when you already have several old plugins. There is also a chance to make errors or miss something like a filtering attribute, even with the code completion that comes with Xrm Tools. To help you qucikly and with virtually no error, add these attributes, Xrm Tools comes with two light bulb actions that generates them with one click.
- Plugin Registration Refactoring Action
- Custom API Registration Refactoring Action
To add all the missing registration attributes you just need to do the following.
- Add
[Plugin]
attribute to an existing plugin - Click on the light bulb 💡 that appears or press Ctrl + ..
- Select Expand
[Plugin]
attribute and add[Step]
and[Image]
attributes
You will see a preview first and when you apply:
- The
[Plugin]
attribute will be expanded to include all the missing properties like Name, FriendlyName and Description if needed (e.g. if the name of the plugin is the same as the type, it won't be added). -
[Step]
and[Image]
attributes will be added with all their necessary properties.
Similar to the previous light bulb action, you to add (this time) two attributes, a [Plugin]
and a [CustomApi]
attribute, but the refactoring action is on the [CustomApi]
attribute. Here's what you need to do:
- Add a
[Plugin]
and a[CustomApi("logical name of the API")]
attribute. Don't forget the name of the API, the code completion lists all the existing APIs to help you pick the right one without fully typing it yourself. - On the
[CustomApi]
attribute, click on the 💡 light bulb the apears or press Ctrl + .. - Select either of the following refactoring actions:
- Expand [CustomApi] attribute.
- Expand [CustomApi] attribute and add Request / Response nested classes.
The refactoring actions will do exactly what they say.