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.

Was it helpful?

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;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top