EventReceiverUtility.RunItemEventReceiver method

Runs code using the SPListItem object from the SPItemEventProperties object.

Namespace:  Microsoft.Office.Server.Utilities
Assembly:  Microsoft.Office.Server (in Microsoft.Office.Server.dll)

Syntax

'Declaration
Public Shared Function RunItemEventReceiver ( _
    eventReceiverName As String, _
    properties As SPItemEventProperties, _
    codeToRun As EventReceiverUtility.ItemEventReceiverCodeToRun _
) As Boolean
'Usage
Dim eventReceiverName As String
Dim properties As SPItemEventProperties
Dim codeToRun As EventReceiverUtility.ItemEventReceiverCodeToRun
Dim returnValue As Boolean

returnValue = EventReceiverUtility.RunItemEventReceiver(eventReceiverName, _
    properties, codeToRun)
public static bool RunItemEventReceiver(
    string eventReceiverName,
    SPItemEventProperties properties,
    EventReceiverUtility.ItemEventReceiverCodeToRun codeToRun
)

Parameters

  • eventReceiverName
    Type: System.String

    The name of the event receiver.

Return value

Type: System.Boolean
Returns Boolean.

Remarks

Optionally, if a version conflict occurs, fall back to creating a new SPSite object or a new SPWeb object and refetching the SPListItem and running the code with it.

See also

Reference

EventReceiverUtility class

EventReceiverUtility members

Microsoft.Office.Server.Utilities namespace