R – Why does the CRM workflow steps run individually but not when two steps exist

dynamics-crmworkflow

I have created a custom workflow activity that copies attachments from a case to an email, both supplied as Lookup parameters. I installed the workflow assembly, created a case with attachments and an email. I then used the workflow design to create a new workflow with one step that runs my custom activity. The attachments copied nicely.

The first use of the custom workflow assembly is to create the email before doing the copying the attachments. I therefore created a new workflow that created an email using details from a case. I set this up as a manual workflow as this it what the end user (CRM consultant) will be doing. I ran that workflow and an email was created as expected.

I then modified the second workflow to add a second step. The second step copies the attachments from the current case to the created email. When I ran the workflow, it failed on step 1.

I modified the workflow so that the email from step 1 was not used in step 2. Instead, I used an existing email as per my very first test. This means that the two steps when executed individually work and if they ran concurrently they should work because there is no link between them. However, when I ran the workflow, it failed on step 1.

Can anyone suggest why this may be happening?

Best Answer

I found the answer so thought I would post it here. I had a class in use that was not marked with the [Serializable] attribute. Once the attribute was added, the problem went away.

Related Topic