Hi,
I've created 2 workflows but they won't pass the validation of crm and halts on waiting.
Using CRM 2011 RU14 On Premise.
The error message is :
Unhandled Exception: System.Activities.InvalidWorkflowException: The following errors were encountered while processing the workflow tree:
'DynamicActivity': The private implementation of activity '1: DynamicActivity' has the following validation error: Compiler error(s) encountered processing expression "DirectCast(CustomActivityStep1_5_converted, Microsoft.Xrm.Sdk.OptionSetValue)".Invalid
L-value expression.:Reference expressions cannot end with Conversion. The provided expression's type must exactly match the type T of VisualBasicReference<T> or LambdaReference<T>.
'DynamicActivity': The private implementation of activity '1: DynamicActivity' has the following validation error: Compiler error(s) encountered processing expression "DirectCast(CustomActivityStep1_6_converted, System.Boolean)".Invalid L-value
expression.:Reference expressions cannot end with Conversion. The provided expression's type must exactly match the type T of VisualBasicReference<T> or LambdaReference<T>.
at System.Activities.Hosting.WorkflowInstance.ValidateWorkflow(WorkflowInstanceExtensionManager extensionManager)
at System.Activities.WorkflowApplication.EnsureInitialized()
at System.Activities.WorkflowApplication.Enqueue(InstanceOperation operation, Boolean push)
at System.Activities.WorkflowApplication.WaitForTurn(InstanceOperation operation, TimeSpan timeout)
at System.Activities.WorkflowApplication.InternalRun(TimeSpan timeout, Boolean isUserRun)
at Microsoft.Crm.Workflow.ActivityHost.StartWorkflowExecution(Activity workflow, ICommonWorkflowContext context)
at Microsoft.Crm.Workflow.ActivityHostBase.StartWorkflow(ICommonWorkflowContext context, Activity preLoadedActivity)
My parameters are coded as followed. I can select the optionset value in crm for this workflow and the boolean is translated to a checkbox.
Optionsetvalues are 1,2 and 3 so that shouldn't be a problem either.
[Input("Output Format")]
[AttributeTarget("pwb_documentgenerator", "pwb_outputformat")]
[Default("1")]
public InOutArgument<OptionSetValue> DocumentOutFormat { get; set; }
[Input("Send Email")]
[Default("False")]
public InOutArgument<bool> SendEmail { get; set; }
Been trying several things but can't get it to work.
Any suggestions?
Regards,
Sven Peeters