This method disables all workflows for an entire company.
Parameter |
Type |
Description |
---|---|---|
organizationKey |
Specifies the unique identifier of the company for which workflows are being disabled. |
The following C# example disables all of the workflows for the sample company.
Be sure to use the URL and port for your workflow server. |
using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; using Microsoft.Dynamics.Workflow.Proxy; namespace WorkflowWebServiceSample { class Program { static void Main(string[] args) { CompanyKey companyKey; // Create an instance of the web service DynamicsWorkflow wsWorkflow = new DynamicsWorkflow(); // Specify the URL used to access the Workflow web service wsWorkflow.Url = "http://WorkflowServer:10072/_vti_bin/WorkflowService.asmx"; // Be sure that default credentials are being used wsWorkflow.UseDefaultCredentials = true; // Create the company key for the sample company companyKey = new CompanyKey(); companyKey.Id = (-1); // Disable the workflows wsWorkflow.DisableWorkflowsForOrganization(companyKey); } } }