Question

I have a workflow which need to update a custom entity(say-customentity) But it will update which record that need to be pass(i.e GUID of that record) using PlugIn. This PlugIn Fires On Some Event Takes GUID Of That Record And Need To Pass This Guid To System Workflow.I Don't Know How To Pass Parameters To system Workflow.

                There Is Some Boundation That Is Why i can not directly trigger that workflow on that event on which PlugIn fires..

Any Kind Of Help Will Be Appreciated.

Thanks, Anish

Was it helpful?

Solution

I'll be honest, I only slightly understand your question.

I believe you are asking: "How can I start a workflow programatically? For example in a plugin?".

In which case you do it like this:

ExecuteWorkflowRequest request = new ExecuteWorkflowRequest()
{
    WorkflowId = workflowId, //Guid of the workflow you want to start
    EntityId = recordId //Guid of your record
};

ExecuteWorkflowResponse response = (ExecuteWorkflowResponse)serviceProxy.Execute(request);

The workflow must be set to "Run On Demand".

Full MSDN article.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top