Tuesday, June 23, 2009

MS CRM 4.0 Custom Workflow Activity assembly update not executing the new code

When you are developing a custom workflow activity for MS CRM 4.0, you have to register this activity with the Plugin Registration Tool provided by MS CRM 4.0 SDK.

When I changed the code of my workflow activity, and tried the Update action in de Plugin Registration Tool, the new code did not execute, it executed the cached version of the previous code. To get your new code to run, perform an IISRESET and restart the Microsoft CRM Asynchronous Processing Service after updating your assembly in the Plugin Registration Tool. It took me a while to find this out, but it’s actually quite logical.

MS CRM 4.0 VPC - remove the 'crm' host header

On the CRM Demo VPC 2009, there is a host header 'crm' defined to redirect to the crm-srv-01:5555 website (the CRM application). When you want to change this, you'll need to do this steps:

- Change the host header in the Internet Information Services window. Select Properties on the CRM Web site, go to the Web Site tab and click Advanced. Hit Edit... and remove the 'crm' host header value

Because you removed your host header, the workflows won't work anymore, because the configured webservice url still points to the host header value. Perform these steps to change this:

- Change this Registry keys in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM: ServerUrl to http://localhost:5555/MSCRMServices; LocalSdkHost to localhost; LocalSdkPort to 5555

- Go to the SQL Server Management Studio, and execute this queries on the MSCRM_CONFIG database (This is not supported! Please take a backup of this database before executing the queries):

USE MSCRM_CONFIG

Update DeploymentProperties SET NVarCharColumn = 'localhost:5555' WHERE ColumnName = 'AsyncSdkRootDomain'

Update DeploymentProperties SET NvarCharColumn = 'localhost:5555' WHERE ColumnName = 'ADSdkRootDomain'

Update DeploymentProperties SET NvarCharColumn = 'localhost:5555' WHERE ColumnName = 'ADWebApplicationRootDomain'

(queries found on http://www.sadev.co.za/content/workflow-doesnt-work-imports-never-happen-emails-dont-flow-and-outlook-clients-cannot-connec)

- Perform an IISRESET and Restart the Microsoft CRM Asynchronous Processing Service.