We have received multiple questions and feedback regarding the capability of adding custom workflow activities in CRM 2011 Online and I would like to provide some responses as well as offer some guidance on how to insert custom logic to workflows in CRM 2011 Online.
Due to a technical limitation we are unable to support custom workflow activities in CRM 2011 Online. Custom workflow activities is a widely used feature and having direct support for it in Online is one of our top priorities, we are considering enabling this support in a future release.
Nonetheless, this doesn’t mean that you cannot achieve having custom code that is executed as part of a workflow. There are multiple alternatives that make use of plugins combined with workflows to execute custom code asynchronously similar to custom workflow activities. I will explore one of these patterns in this article by using a real life scenario example.
Scenario: My salespersons constantly call leads to offer our products. If the lead is interested we qualify the lead (convert to account) and add it to a marketing list for prospective buyers. Otherwise we disqualify the lead. We need a call script for the salespersons which seamlessly performs the lead qualification process in the background.
Step 1: Identify which is the logic that is not supported by the CRM Workflow Designer and what inputs/outputs are required.
The only part of my workflow that requires custom code is to add members to the marketing list. Everything else can be handled by configuring a dialog using the CRM workflow designer. For my custom code I don’t need any output but I will need two input parameters: The marketing list and the account which should be added to the list.
Step 2: Create a custom entity to encapsulate the information from step 1.
I will create a custom entity called “Add to marketing list action” hidden from the sitemap. To handle the inputs/outputs it will have two lookup attributes: A marketing list and an account.
Step 3: Define the process in the workflow designer.
I will define the dialog and for the custom action, I will insert a Create step for my custom entity. In the form I will configure the inputs using form assistant:
Step 4: Write the custom code in a plugin
I have my code which I will register in a sandboxed plugin which will trigger on create of “Add To Marketing List Action”.
public sealed class AddMemberToMarketingList : IPlugin
public void Execute(IServiceProvider serviceProvider)
IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService
IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)
IOrganizationService service = serviceFactory.CreateOrganizationService
(context.UserId);Entity customEntity = (Entity)context.InputParameters["Target"];
AddMemberListRequest request = new AddMemberListRequest();
request.EntityId = ((EntityReference)customEntity["new_account"]).Id;
request.ListId = ((EntityReference)customEntity["new_marketinglist"]).Id;
Step 5: Clean up.
You don’t want to end up with thousands of “Add To Marketing List Action” entity instances. Therefore you can simply register an asynchronous plugin on Create of “Add To Marketing List Action” which will delete them immediately.
Done! Now you can ask salesperson to start the Dialog on lead entities and they won’t have to worry at all about the marketing lists or the lead qualification process. This approach (and other similar patterns) will provide the same benefits of custom workflow activities:
Are Custom workflow activities supported on CRM 2011 on premise?
Yes, but not in Online.
You cannot seriously count THIS as a solution. This must count as a workaround...
Right, you can interpret this article as a workaround if you absolutely need a custom action in a workflow for CRM 2011 Online. The “solution” would be a custom workflow activity but as mentioned in this article, due to technical limitations we are not able to support them for CRM 2011 Online at this time.
So...any update on the availability of a custom workflow activity now that the product has gone RTM? Roadmap...anything. Throw me a bone here!
Is it known when a release is coming which already supports custom workflow activities?