dynamics-crmcrmxrmxrmtoolbox

XrmToolBox PluginRegistration. Edit Plugin Step Configuration from plugin code


How can I modify the Unsecure and Secure Configuration in plugin code for step?

For example, I have a plugin and I will send it to my friend. I want this plugin to clean or modify all information that my friend has in his XrmToolBox Plugin Step Secure Configuration field and add mine (for me is necessary to add mine config in this field). Can I do it from code in my plugin?


Solution

  • Let's make the things straight.
    CRM Plugin is an executable code logic for extending the platform execution pipeline like do something (ex. Assign/Update) after something (ex. Create/Update) happens.
    Plugin registration tool (PRT) is useful for registering the Plugin assembly (dll) & steps to execute per our expectation.
    Secure/Unsecure config for Plugin step is just like web.config in our web application. Read more

    You want to configure certain key/value pair, for example - some external web service credentials, then put it in secure config of that particular plugin step using PRT, so that you can consume it inside the plugin step code logic.

    We will not update the secure config from the plugin code, rather we will just consume it.

    If you are shipping your environment plugin steps to your friend environment, then give the plugin assembly & step as a solution package, once the solution is imported in your friend environment - the XrmToolBox PRT will show the changes. Or connect the two environments in different PRT sessions & verify the differences for config merge process.

    If you want to develop a console app or something to do the deployment for you, read the below link: Programatically Updating the Secure Configuration of a Plug-in Step