Sunday, February 10, 2008

MSCRM 4.0 Workflow: Workflow forever at the Waiting state

If encountered workflows never get executed. First step is to create a simple workflow (for whatever entity, e.g. Update a value upon creation), and perform an action that can trigger this workflow.

Secondly check the System Jobs to find out whether there is any issue with the workflow. For example, the workflow probably at the Waiting state (Status Reason) for long period of time (or forever):


Use Advanced Find to reveal the Error Code and Message Columns:


If the Message column shows the error:
System.Net.WebException: The request failed with HTTP status 400: Bad Request.

This could be due to the Async Service was unable to connect to the correct URL. To verify, connect to the database: MSCRM_CONFIG, and execute statements below:

SELECT NVarCharColumn
FROM deploymentproperties
WHERE columnname = 'AsyncSdkRootdomain'

SELECT NVarCharColumn
FROM deploymentproperties
WHERE columnname = 'ADSdkRootdomain'

SELECT NVarCharColumn
FROM deploymentproperties
WHERE columnname = 'ADWebApplicationRootdomain'

Ensure the NVarCharColumn column shows the correct URL, else it can be fixed with the following statements (replace server and port with the appropriate values):

UPDATE DeploymentProperties SET 
        NVarCharColumn = '<server>:<port>'
WHERE ColumnName = 'AsyncSdkRootdomain'

UPDATE DeploymentProperties SET 
        NVarCharColumn = '<server>:<port>'
WHERE ColumnName = 'ADSdkRootdomain'

UPDATE DeploymentProperties SET 
        NVarCharColumn = '<server>:<port>'
WHERE ColumnName = 'ADWebApplicationRootdomain'

No comments: