0

I expose my scenario and my issue.

Scenario

I have one custom list in SharePoint 2010 Foundation called Actions. This list has one event receiver that override this methods:

  • ItemAdded
  • ItemUpdated
  • ItemCanceled

Inside the method ItemAdded I perform these actions:

  • Update column's item
  • Update item's roles
  • Add items inside other lists

Now, inside my SiteCollection there is another Event Receiver of list Projects that when one item is added perform these actions:

  1. Read data from one list called Task Template
  2. Copy retrieved data inside Task list.

Issue

When I add one item inside Projects list code of ItemAdded of Actions list raise one COMException. Below is some more info about exception:

Your changes conflict with those made concurrently by another user. If you want your changes to be applied, click Back in your Web browser, refresh the page, and resubmit your changes. Stacktrace: at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx) at Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, ...

Inner Exception

Exception type: System.Runtime.InteropServices.COMException Message : Save Conflict.

Your changes conflict with those made concurrently by another user. If you want >your changes to be applied, click Back in your Web browser, refresh the page, >and resubmit your >changes.0x81020015 Stacktrace: at Microsoft.SharePoint.Library.SPRequestInternalClass.AddOrUpdateItem(String bstrUrl, String

Debugging my application I discovered that exception above is raised when I try to perform this action:

item.Update();

How do I resolve this?

0

You have to register the ItemAdded event as Synchronous event.

You can define it programmatically: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.speventreceiverdefinition.synchronization.aspx

Or in the Receiver element of the feature definition: http://msdn.microsoft.com/en-us/library/ff512765.aspx

https://social.msdn.microsoft.com/Forums/en-US/b97c8cb0-fc95-4a2e-8af7-d156e91a8692/save-conflict-while-updating-splistitem-for-document-library

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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