SPWorkflow.CreateHistoryEvent Method (SPWeb, Guid, Int32, SPMember, TimeSpan, String, String, String)
Writes a workflow history event to the specified workflow history list.
Namespace: Microsoft.SharePoint.Workflow
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Syntax
'Declaration
Public Shared Sub CreateHistoryEvent ( _
web As SPWeb, _
workflowId As Guid, _
eventId As Integer, _
user As SPMember, _
duration As TimeSpan, _
outcome As String, _
description As String, _
otherData As String _
)
'Usage
Dim web As SPWeb
Dim workflowId As Guid
Dim eventId As Integer
Dim user As SPMember
Dim duration As TimeSpan
Dim outcome As String
Dim description As String
Dim otherData As StringSPWorkflow.CreateHistoryEvent(web, workflowId, _
eventId, user, duration, outcome, _
description, otherData)
public static void CreateHistoryEvent(
SPWeb web,
Guid workflowId,
int eventId,
SPMember user,
TimeSpan duration,
string outcome,
string description,
string otherData
)
Parameters
web
Type: Microsoft.SharePoint.SPWebThe SharePoint site on which the workflow instance is located.
workflowId
Type: System.GuidThe ID of the workflow instance that generated this workflow history event.
eventId
Type: System.Int32The type of workflow event.
user
Type: Microsoft.SharePoint.SPMemberThe user responsible for the workflow history event.
duration
Type: System.TimeSpanThe duration of the workflow history event.
outcome
Type: System.StringA description of the workflow event, limited to 255 characters. This information is displayed on the workflow status page.
description
Type: System.StringA longer description of the workflow event. This information is displayed on the workflow status page.
otherData
Type: System.StringAny other data to be captured about the workflow history event. This information is not displayed on the workflow status page.
Remarks
The eventId parameter takes an enumerated type, based on the SPWorkflowHistoryEventType enumeration.
See Also
Reference
Microsoft.SharePoint.Workflow Namespace
Other Resources
Workflows in SharePoint Foundation