共用方式為


SPWorkflowTask.AlterTask Method

Updates the specified task with the specified property values.

Namespace:  Microsoft.SharePoint.Workflow
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
Public Shared Function AlterTask ( _
    task As SPListItem, _
    htData As Hashtable, _
    fSynchronous As Boolean _
) As Boolean
'Usage
Dim task As SPListItem
Dim htData As Hashtable
Dim fSynchronous As Boolean
Dim returnValue As Boolean

returnValue = SPWorkflowTask.AlterTask(task, _
    htData, fSynchronous)
public static bool AlterTask(
    SPListItem task,
    Hashtable htData,
    bool fSynchronous
)

Parameters

  • fSynchronous
    Type: System.Boolean

    true to wait up to 30 seconds for the outcome of the attempted update; otherwise false.

Return Value

Type: System.Boolean
If true is passed as the argument to fSynchronous, this method waits up to 30 seconds to determine whether the attempted update was accepted by the workflow schedule as valid. The method then returns true if the update was accepted and not rolled back, or false if the update was not accepted. If false is passed as the argument to fSynchronous, this method always returns true.

Exceptions

Exception Condition
ArgumentNullException

The argument to the task parameter is a null reference (Nothing in Visual Basic).

NotSupportedException

The content type of the item passed to the task parameter is not derived from the WorkflowTask content type.

Remarks

This method cannot be used to modify read-only properties of a task.

See Also

Reference

SPWorkflowTask Class

SPWorkflowTask Members

Microsoft.SharePoint.Workflow Namespace

WorkflowTask

Other Resources

Workflow Task Forms (SharePoint Foundation)