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)


Public Shared Function RunItemEventReceiver ( _
    eventReceiverName As String, _
    properties As SPItemEventProperties, _
    codeToRun As EventReceiverUtility.ItemEventReceiverCodeToRun _
) As Boolean
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


  • eventReceiverName
    Type: System.String
    The name of the event receiver.

Return Value

Type: System.Boolean
Returns Boolean.


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


EventReceiverUtility Class

EventReceiverUtility Members

Microsoft.Office.Server.Utilities Namespace