Hi,
I already have a async workflow in place in CRM but I would like to convert the workflow to synchronous workflow and set ‘Execute’ as “The user who made changes to the record”
in the synchronous workflow programmatically. I am able to find the required workflow and deactivate it. How do I set the workflow's mode property to WorkflowMode.Realtime?
//Deactivate the workflow
var deactivateRequest = new SetStateRequest
{
EntityMoniker = new EntityReference (Workflow.EntityLogicalName, ent.Id),
State = new OptionSetValue((int)WorkflowState.Draft),
Status = new OptionSetValue(1)
};
orgService.Execute(deactivateRequest);
//Convert workflow to Synchronous workflow
UpdateRequest updateWorkflowType = new UpdateRequest()
{
//How to set Mode property to WorkflowMode.Realtime?
};
orgService.Execute(updateWorkflowType);
Thanks,
Anna'