I'm getting the following error when updating a listitem
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. Microsoft.SharePoint.Client.ServerException
I'm doing a number of updates on a listitem and need to call update for the changes to take affect to then perform the next operation. Is it possible to detect when the first update has completed successfully and then do the next update.
Or is there another way, I'm doing two updates on this listitem. I'm also checking out the item before and after.
Microsoft.SharePoint.Client.File file = clientContext.Web.GetFileByServerRelativeUrl(u.LocalPath); ListItem listItem = file.ListItemAllFields; clientContext.Load(listItem); clientContext.ExecuteQuery(); file.CheckOut(); listItem["Title"] = "Title Updated"; listItem.Update(); clientContext.ExecuteQuery(); listItem.RefreshLoad(); clientContext.ExecuteQuery(); object title = listItem["Title"]; listItem["Title"] = "Title Updated After refresh"; listItem.Update(); file.CheckIn("Test", CheckinType.OverwriteCheckIn); clientContext.ExecuteQuery();
The above code looks to work. If I make a change in the WEB UI and put a breakpoint on
listItem.RefreshLoad(); I get the value entered in the UI.
Is there a way to determine if a update or
executequery has completed on the server side?