Workflow activities in CRM Online!

Custom workflow activities are one of my favorite extension points of CRM. The power workflows gives the customers are great as they can easily change the content of outgoing emails, todos etc. With the ability of custom workflows I can connect the workflow engine to anything in the world, from credit rating checks, integrations to other systems or just adding a bit more complex logic than what the standard activites include.

One of the major drawbacks of the current version of CRM-Online  (as of march 2012) in comparisson to On-premise is from my perspective that custom workflow activies cannot be deployed in CRM-Online. I asked developer evangelist at Microsoft Sweden, André Henriksson about this and his comment was that it was probably due to the fact that the workflow foundation team didn’t support sandboxing of custom workflow activities. At SharePoint Exchange Forum I had the oppotunity to discuss this with SharePoint MVP Eric Shupps and he mentioned that in SharePoint there was full support for custom workflows. This made me a bit puzzled since this implied that the SharePoint team had managed to create a workaround for the lack of isolation for custom workflow activities that the CRM team hadn’t.

However, in the upcoming R8, release for Dynamics CRM 2011, Microsoft have annonced (http://crmpublish.blob.core.windows.net/docs/ReleasePreviewGuide.pdf) that there will be support for custom workflow activities in CRM Online. This is great news, but as the functionality will be based on sandboxing there might still be limitations to what can be done within the sandbox, for instance on which external connections are allowed. This remains to be seen, but the news of support custom workflow activities in CRM Online is still something I have waited for a long time!

Gustaf Westerlund
CEO, Chief Architect and co-Founder at CRM-konsulterna AB
www.crmkonsulterna.se

Problem with Custom Workflow Activities in CRM 2011

The workflow activities framework for CRM 2011 has been upgraded from CRM 4.0. The dependance properties have been removed and it now support the simplified datatypes used in CRM 2011 like DateTime.

I was developing a custom activity today and I had an output argument that was of the type EntityReference. However, when I tried to run it I got a weird error:

“The argument of type ‘Microsoft.Xrm.Sdk.EntityReference’ cannot be used. Make sure that it is declared on an activity.”

The argument declaration looked like this:

[Output(“The Output of special entity”)]
[ReferenceTarget(“new_specialentity”)]
public OutArgument specOut { get; set; }

And I am trying to set it with the following code:

specOut = new OutArgument();
Entity outent = entities.Entities[0];
specOut.Set(executionContext, outent.ToEntityReference());

I had also tried creating the entity reference with a default contstructor and filling id and logicalname, with the constructor setting id and logicalname. I had even tried setting it using the entity directly but they all give the same error. I had not found anything useful on the internet or in the SDK.

After some rethinking I looked closer at the error message and thought that there might be something wrong with the declaration or definition of the OutArgument. And after some tries I found that the error was that I had created a new OutArgument which is wrong, it is precreated and this was the reason for the error. Hence I just removed the line:

specOut = new OutArgument();

and it work like it should have from the beginning.

It is always interesting to work with new technology!

Gustaf Westerlund
CEO, Chief Architect and co-Founder at CRM-konsulterna AB

www.crmkonsulterna.se