Sign up ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a client windows application that is uploading many rows of data to a list. However, I don't want the event handler on the list to fire while rows are being added via the windows application.

Is there a way in the Client Object Model to disable, or remove and add the list event handler?


share|improve this question

3 Answers 3

up vote 0 down vote accepted

If you create a web service as @moontear suggest you can use this solution by Adrian Henke to update items without triggering events:

public class SPListItemExtensions : SPItemEventReceiver, IDisposable
    private readonly bool _oldValue;

    public SPListItemExtensions()
        _oldValue = EventFiringEnabled;
        EventFiringEnabled = false;

    #region IDisposable Members

    public void Dispose()
        EventFiringEnabled = _oldValue;



using (new SPListItemExtensions())


share|improve this answer

Unfortunately you will not be able to access the event receivers using the COM.

See the MSDN documentation on the SP.List object. Your only chance would be to develop some kind of custom webservice which you could call from you client code and which disables the event receiver temorarily.

share|improve this answer

@eirikb: Unfortunately, there is a "minor" problem with this approach. Although it is not well documented, the property has (wisely) no global effect. It does not disable all of the event receivers in the farm, nor does does it disable triggering event receivers in the current list for activities occured on other threads. It has a scope local to the current tread. See this answer for reference. What does it mean for us? If you create and call a custom web service that sets the EventFiringEnabled property, it has effect only in the scope ot that call, but has no effect at all of your code executed from the client object model.

Is there a way in the Client Object Model to disable, or remove and add the list event handler?

So as far as I know, you cannot disable the event receiver from the client object model. But in SP 2013 you can remove and add the event receiver. If you need to limit the effect of this change to your current process, use this approach only if you are absolutely sure your process is the only one that alters data in your list!

To remove, you should call the deleteObject method of the corresponding SP.EventReceiverDefinition instance.

List list = web.Lists.GetById(listId);
EventReceiverDefinition eventReceiver = list.EventReceivers.GetById(yourEventReceiverId);

You can add a new handler via the add method of the SP.EventReceiverDefinitionCollection, passing an SP.EventReceiverDefinitionCreationInformation instance as parameter.

List list = web.Lists.GetById(listId);
list.EventReceivers.Add(new EventReceiverDefinitionCreationInformation {
    EventType = EventReceiverType.ItemUpdated,
    ReceiverName = "MyRemoteEventReceiverItemUpdated",
    ReceiverClass = "Your.Namespace.YourClass",
    ReceiverAssembly = "Strong Name Of Your Assembly",
    SequenceNumber = 10000}
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.