WorkflowAssociation.Enabled property
Gets or sets a value that specifies whether new workflow instances will be allowed for this workflow association
Namespace: Microsoft.SharePoint.Client.Workflow
Assembly: Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)
Syntax
'Declaration
Public Property Enabled As Boolean
Get
Set
'Usage
Dim instance As WorkflowAssociation
Dim value As Boolean
value = instance.Enabled
instance.Enabled = value
public bool Enabled { get; set; }
Property value
Type: System.Boolean
Returns Booleantrue if new workflow instance is allowed for this workflow association; otherwise, returns false. The default value is
Exceptions
Exception | Condition |
---|---|
[System.InvalidOperationException] | The value is true and this workflow association is based on a non-declarative workflow template that has been deactivated. Error code: -1. |
Remarks
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.