Wednesday, June 1, 2011

Unable to import a XAML workflow into CRM?

Do you get error messages like "You do not have the correct security role to do this. Only a user with the deployment administrator role can create or update processes that are created outside the Microsoft Dynamics CRM Web application." or "This process cannot be created, updated, or activated because it was created outside the Microsoft Dynamics CRM Web application. Your organization does not allow this type of process." ?

With CRM 2011, workflows integrate with WF4 giving us all the power of the WF4 engine and designer. Nevertheless, there are some caveats to this approach. First, for now, custom XAML workflows are only available on premises (for the same reason as custom workflow activities are only available on premise: They cannot be sandboxed). Second, importing custom XAML into CRM requires the highest privilege (deployment administrator) and the organization must be configured to support XAML workflows (disabled by default).

These are the steps to follow before you import custom XAML:

  1. Ensure you are a deployment administrator. To verify this, you can try to open the Deployment Manager. If you are able to do so then you have the privilege. Otherwise you will need to ask your deployment administrator to add you as a deployment administrator (in DM) or to import the custom XAML for you.


  2. Make sure that the organization supports declarative (XAML) workflow. To do so, you should run this script in powerShell:
Add-PSSnapin Microsoft.Crm.PowerShell
$setting = Get-CrmSetting CustomCodeSettings
$setting.AllowDeclarativeWorkflows=1
Set-CrmSetting $setting
Get-CrmSetting CustomCodeSettings
iisreset



Now you are all prepared to import custom XAML. This is probably the easiest way to import a custom XAML workflow:

  1. Create a workflow using the CRM process designer and select the primary entity you will use.
  2. Add the workflow to a solution
  3. Export the solution as unmanaged and you will find a xaml file in the solution zip file under a folder called Workflows
  4. Edit the xaml file in Visual Studio 2010
  5. Replace the xaml file in the original solution zip file
  6. Import the solution back to CRM and voila.
There is also a walk-through in the SDK that provides a sample for doing so. Note that in CRM 2011, custom XAML dialogs are not supported!

    2 comments:

    1. Hi Gonzalo,

      I am facing almost the similar issue...but when i am trying to import managed solution to MS CRM 2011 On premises...Inside it contain one dialog process and because of that i am getting an error....would be great if you could help me out in this.... you can reach me on tsheikh@infinite-ind.com....waiting for your fast reply
      Thanks in advance

      ReplyDelete
    2. Hi, you should try the MSDN forums to help you with the failure!

      ReplyDelete