Wednesday, January 21, 2015

Workflow Waiting Error on Email Creation Step

I ran into an issue while doing some testing today. I had a workflow that I had modified, and I changed the email notification that is created by the workflow to email me. The workflow stayed in a waiting status, and it was stuck at the email creation step. When I opened the system job I found the following error in the details section:
Cannot create the given type without the required parameters.Plugin Trace:[Microsoft.Crm.Workflow: Microsoft.Crm.Workflow.Activities.EvaluateExpression][EvaluateExpression] 
Error Message:Unhandled Exception: Microsoft.Crm.CrmException: Cannot create the given type without the required parameters.   at Microsoft.Crm.Workflow.Services.ExpressionServiceBase.CreateCrmType(WorkflowPropertyType type, Object[] values)   at Microsoft.Crm.Workflow.Services.ExpressionServiceBase.EvaluateExpression(ExpressionOperator expressionOperator, Object[] parameters, Type targetType)   at Microsoft.Crm.Workflow.Activities.EvaluateExpression.Execute(CodeActivityContext context)   at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)   at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

I found this blog post by Simon Harvey that gives one cause for the error with a fix that worked for me.
Fix: Microsoft.Crm.CrmException: Cannot create the given type without the required parameters.
Basically, this error comes after changing the recipients of an email created by a workflow. Delete all values in the to, cc, and bcc, save (possibly save and close) the email, and add the proper values back into it. 

This worked great for me! Thanks, Simon.

No comments:

Post a Comment