Tag Info

Hot answers tagged

6

I hade the exact same problem last week and found no built in way of solving it. What I ended up doing was checking the value of beforeProperties and afterProperties of what I wanted to update, and if there was no difference, then I broke out of the method. I actually wrote a blog post about it. This is an annoying problem that I hope Microsoft improves in ...


2

Disable event firing before you Update your item. this.EventFiringEnabled = false; item.Update(); this.EventFiringEnabled = true; Note that this might cause problems when item.Update() throws an exception, leaving your eventfiring off.. you can use a try/catch to solve this. hope I could help : )


1

this.EventFiringEnabled = false; is used in Server object model. However, there doesn't seem to be its equivalent in Client object model. So the alternative is to check the field value first before making any changes to avoid the update operation recurrence. See similar question here: ...


1

I have not personally run into this issue but it sounds a lot like an unsafe update error. Assuming properties.ListItem is a reference to the newly moved file and not null or somehow have a reference to the old file location, you can try something like this: movedFile.Web.AllowUnsafeUpdates = true; movedFile.Update(); movedFile.Web.AllowUnsafeUpdates = ...


1

What about checking out file before modifying properties? You check if file is available: if true, you check out file, do changes and check it back in. if file is already checked out you just wait (random amount of time) and then get file status again - after this you have available file or wait again. There is no need to modify the file, but you can use ...



Only top voted, non community-wiki answers of a minimum length are eligible