SPWorkflowAssociation.Enabled Property
Gets or sets a value that indicates whether the workflow association is enabled.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
| Exception | Condition |
|---|---|
| InvalidOperationException |
The corresponding workflow feature is deactivated or the workflow is not deployed as part of a feature. |
Setting the Enabled property to false causes the workflow association not to be displayed in the user interface. This prevents users from starting new instances of the workflow. In addition, workflows that are configured to start automatically are no longer able to start automatically.
Setting the Enabled property to true does not change the values for the AllowManual, AutoStartCreate, or AutoStartChange properties. However, the option to start the workflow is again available in the user interface, and workflows that are configured to start automatically will start automatically.