Register and Use a Custom Workflow Activity Assembly
After you compile your custom workflow activity to create an assembly, you have to register the assembly with Microsoft Dynamics CRM. Your custom activity will then appear in the process form of Microsoft Dynamics CRM Online or Microsoft Dynamics CRM 2011 depending on which deployment you registered the custom workflow activity with.
In This Topic
Enable or Disable Custom Code
You can use Windows PowerShell to enable or disable custom code for an on-premises server as described here. Alternatively, you can use the Deployment Web service. For more information, see Deployment Entities and Deployment Configuration Settings to learn how to set the CustomCodeSettings.AllowExternalCode property.
To enable XAML workflows
-
Open a Windows PowerShell command window.
-
Add the Microsoft Dynamics CRM PowerShell snap-in:
Add-PSSnapin Microsoft.Crm.PowerShell -
Retrieve the current setting:
$setting = get-crmsetting customcodesettings
-
Modify the current setting:
$setting.AllowExternalCode="True"
set-crmsetting $setting
-
Verify the setting:
get-crmsetting customcodesettings
To disable XAML workflows
-
Open a Windows PowerShell command window.
-
Add the Microsoft Dynamics CRM PowerShell snap-in:
Add-PSSnapin Microsoft.Crm.PowerShell -
Retrieve the current setting:
$setting = get-crmsetting customcodesettings
-
Modify the current setting:
$setting.AllowExternalCode=0
set-crmsetting $setting
-
Verify the setting:
get-crmsetting customcodesettings
Register a Custom Workflow Activity
Custom workflow activity assemblies are registered using the Plug-in Registration tool. The tool provides a graphical user interface and supports registering assemblies that contain plug-ins or custom workflow activities. When registering an assembly that contains custom workflow activities with Microsoft Dynamics CRM Online, you must register the assembly in the sandbox (partial trust). Support for sandbox execution of custom workflow activities was added in the Microsoft Dynamics CRM 2011 Update Rollup 12 and Microsoft Dynamics CRM December 2012 Service Update releases.
For more information about how to register and deploy a custom activity assembly by using the tool, see Specify the Name and Group Name for a Custom Workflow Activity.
Note |
|---|
| As of version 5.0.13 of the SDK, you can find the Plug-in Registration tool’s executable file in the Bin folder of the SDK download. In previous SDK releases, you had to build the tool from source code provided in the Tools\PluginRegistration folder. The tool can be added to the Microsoft Visual Studio Tools menu as an external tool to speed up the development process. |
Use a Custom Workflow Activity in a Process
After you have registered your custom workflow activity assembly, you can use it in the process designer in Microsoft Dynamics CRM.
To use your custom workflow activity in a process:
-
Log on to Microsoft Dynamics CRM.
-
In the Navigation Pane, click Settings. Under Process Center, click Processes.
-
In the process pane, create or open an existing process.
-
For the process, click Add Step. Your custom workflow activity name will appear in the drop-down list.
See Also
Microsoft Dynamics CRM 2011
Send comments about this topic to Microsoft.
© 2013 Microsoft Corporation. All rights reserved.
Note