Development

Actions: usage of input/output arguments in plugins that handle Actions

The main message is that input/output arguments are available in the InputParameters/OutputParameters’ collections of PluginExecutionContext.

Usage of Input argument
The following code shows how to check that the Input Argument was passed and got value:

Usage of Output Argument
The following code shows how to set the Output argument:

One thing you should remember is that step that handles your action and sets Output arguments has to be registered on Post Operation (40).
For those who use the CRM Developer Toolkit registration of new plugin, registration of your step in code of your plugin and part of RegisterFile.crmregister file is:

For those who use PluginRegistration tool:

4 Comments on “Actions: usage of input/output arguments in plugins that handle Actions

  1. Hello Andrii,

    I wonder why “step that handles my action and sets Output arguments has to be registered on Post Operation (40).”? There is a good reason?

    And does that means we should use sevice Update in order to update the trigger record?

    Thank you

    1. Moshe, I would love to get an explanation as well but I believe this is how it was built and designed. Yes, that will mean that you will have to use Update and explanation is really easy – you have not only bound Actions. You have unbound as well. What entity do you want to work with when you use undound action?

  2. Can I use the output parameter in action steps, after I set the output parameter in the plugin call?

    1. Ashar, I’m afraid that no because you can set values only in post-operation plugin and all the process logic is executed in “core”-30 operation.

Leave a Reply

Your email address will not be published. Required fields are marked *