Partilhar via


CreateItemActivity.Execute Method

Creates an item in the specified list or document library.

Namespace:  Microsoft.SharePoint.WorkflowActions
Assembly:  Microsoft.SharePoint.WorkflowActions (in Microsoft.SharePoint.WorkflowActions.dll)

Syntax

'Declaration
Protected Overrides Function Execute ( _
    context As ActivityExecutionContext _
) As ActivityExecutionStatus
'Usage
Dim context As ActivityExecutionContext
Dim returnValue As ActivityExecutionStatus

returnValue = Me.Execute(context)
protected override ActivityExecutionStatus Execute(
    ActivityExecutionContext context
)

Parameters

Return Value

Type: System.Workflow.ComponentModel.ActivityExecutionStatus
The status of the activity.

Remarks

The workflow runtime calls this override to create an item in the specified list or document library and caches the item before it is committed to the database. After successfully creating the item, this override stores the item ID in the NewItemId property.

For creating a document on the specified document library, this override overwrites the document if it already exists in the document library and the value of the Overwrite property is true.

For creating an item on the specified list, this override always creates a new item.

Visual Studio 2005 Designer for Windows Workflow Foundation does not support this workflow activity. This workflow activity is designed to be used in a declarative, code-free workflow, for example, in a workflow you might create by using a rules-based, code-free workflow editor such as Microsoft Office SharePoint Designer 2007. As a result, the workflow activity might not include functionality, such as registering for workflow events, that might be used in compiled workflow assemblies that are created by using the Visual Studio 2005 Designer for Windows Workflow Foundation.

See Also

Reference

CreateItemActivity Class

CreateItemActivity Members

Microsoft.SharePoint.WorkflowActions Namespace

Other Resources

Workflows in SharePoint Foundation

Workflow Activities for SharePoint Foundation

Workflow Development Tools Comparison

Workflow Development in SharePoint Designer