0

I have a simple custom workflow activity with the following parameter:

[Input("String")] public InArgument<string> String { get; set; }

In the execute method I only have a throw InvalidPluginExecutionException to show me the value of Sring:

throw new InvalidPluginExecutionException(String.Get(executionContext));

Then I created a dialog in crm 2016 with a page that asks for a text value and then I invoke the custom workflow activity with the value the user entered in the dialog.

enter image description here

enter image description here

But when executing after entering the text parameter the dialog gives an error when passing the value to the custom workflow activity:

enter image description here

enter image description here

Can somebody tell me what's wrong, the workflow activity parameter is just a string and the input in the dialog is also a string. If I take the parameter from the workflow and stop passing the argument from the dialog it runs as expected. I have also tried other types of InArguments ex.: int.

budahead
  • 185
  • 1
  • 9
  • Isn't the error message because all the workflow does is throw an exception" `throw new InvalidPluginExecutionException(String.Get(executionContext));` ? And what do you mean by `if I take the parameter from the workflow and stop passing the argument` ? – dynamicallyCRM Sep 21 '16 at 17:13
  • No, the problem is not the exception because the workflow doesn't even run. As I said if I make the workflow without the InArgument String property, that is, without any parameter and throw a message like "It got here" the workflow runs as expected while invoked by the dialog. – budahead Sep 21 '16 at 17:20
  • I quickly re-created the dialog with a workflow, exactly like the one you posted and the workflow triggered as expected. Maybe try restarting IIS? or if you are on-line increase the assembly version to force CRM to refresh the assembly? – dynamicallyCRM Sep 21 '16 at 17:50
  • I restarted IIS and also increased the assembly version but it's still giving the error. :( I'm going to try on another crm server to see if the problem is in this one. – budahead Sep 21 '16 at 18:11
  • 1
    As you are on-prem, turn on tracing, read the logs, they almost always point you in the right direction even if they aren't obvious. – dynamicallyCRM Sep 21 '16 at 19:20

0 Answers0