Wednesday, January 30, 2013

Understanding and Development of Custom Workflow Activities in Microsoft Dynamics CRM

As we all know with the release of rollup 12 we can develop custom workflow activity for CRM 2011 online too. We can develop custom workflow for CRM online here are the steps to develop custom workflow activity for CRM 2011 online using visual studio 2012 although there is no difference between developing workflow activity in VS 2010 and VS 2012 but due to great feature of VS 2012 i decided to make the workflow activity in VS 2012.

1. Latest SDK (Download Latest SDK)
2. CRM 2011 must have rollup 12 (By default all online CRM has been update to rollup 12)

Step 1: Create a new CRM Packedge in Visual Studio give any name

Step 2: After you select your project type you will saw a popup box asking for your credtionals fill the form and click ok

Step 3: Add a new CRM 2011 workflow liberary in CRM Packedge solution

Step 4: Right click on CRM 2011 workflow library and click on properties and go to Signin tab

Step 5: From chosse a signing name key file optionset select new the below window will opens give any name and uncheck the checkbox click ok and save your project

Step 6:
After signing your workflow add a new workflow activity class click on your workflow activity -> right click-> add new item

Step 7:
Select workflow activity class as your new item after giving name click ok

Step 8:After you select workflow activity class CRM asks you for below information fill the information and all the information is required

Step 9: Implement your custom business logic

Step 10:  After completing your implementation right click on RegisterFile.crmregister and change IsolationMode to Sandbox

Step 11: Go to Build -> Deploy from visual studio 2012 main menu.
Step 12: After deployment complete you can see your custom workflow activity in your steps

Note: The error that i found while developing custom workflow activity is
1. "Error registering plugins and/or workflows. Description name must be specified Parameter name: description"  if i skip step 8 i got the above error so make sure your have filled all the fields that is in the form.
2. Error registering plugins and/or workflows. Action failed for assembly 'CrmPackageOnline.WorkflowOnline, Version=, Culture=neutral, PublicKeyToken=f24fa33afcfbc3ec': Assembly must be registered in isolation.    C:\Program Files (x86)\MSBuild\Microsoft\CRM\Microsoft.CrmDeveloperTools.12.targets    176    4    CrmPackageOnline
if you skip step 10
Resolution change the RegisterFile.crmregister xml and IsolationMode to Sandbox