Tag Info

New answers tagged

-1

use static variables at top to handle this.. static variables are not re-initialized for instances of class. bool itemAddedWasCalled = false; protected void ItemUpdated(properties) { if(!itemAddedWasCalled) { //Update code } else { itemAddedWasCalled = false; } } protected void ItemAdded(properties) { //your code for ...


1

Use tokens in your custom action definition to pass values to the new form. More on this here: https://msdn.microsoft.com/en-us/library/office/ff458385%28v=office.15%29.aspx Add another custom action with code behind to handle the new form OnLoad event: <CustomAction Id="NewFormCustomActionId" Location="NewFormToolbar" ...


1

You can make use of the SequenceNumber property that is associated with the SPEventReceiverDefinition object. https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.speventreceiverdefinition.sequencenumber.aspx This property determines the order in which event assemblies execute. This is especially important when there are multiple assemblies that ...


0

EventFiringEnabled is not the answer as it prevents firing new events as the result of updates done by my code. The cause of the error is that ItemDeleting event is synchronous. It means that its receivers are executed in the same thread as original operation and moreover all other sync event receivers. And only one redirect is OK. The 2nd one causes error ...



Top 50 recent answers are included