Question

I have a Deleting Event Receiver, say, on list A. Also I have other Deleting Event Receiver on list B. There is a deleting method in both receivers, which deletes items of each other. So, when an item is being deleted in list A the event receiver on list B also rises to delete item in list A. Cyclic calling of event receivers appears.

How can I escape of this situation? I need delete items from list A and list B wherever Event Receiver is called.

Était-ce utile?

La solution

Did you try disabling the events ?

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.speventreceiverbase.eventfiringenabled.aspx

So you set in your event receiver code at the beginning

this.EventFiringEnabled = false;

// Do deletion of other item

this.EventFiringenabled = true;
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top