Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I've been working in a feature for mi current project that involves folders. I've noticed that If you add files or subfolders to a folder and then you try to update the folder's metadata an exception will be thrown (saying that the the item was modified by [put the userloginname here]), unless you reload the folder (aka fetch it again from the db) before doing the update.

Anyone cares to explain me why this behavior? Is this documented Thanks!

share|improve this question
add comment

1 Answer

This is done to prevent editing of stale data. To get around this you need to request the folder object again after files or sub-folders have been added. This will make sure the metadata changes are done on the latest data. Here are the steps:

  1. Retrieve folder object
  2. Add files or sub-folders (which made changes to the folder object)
  3. Retrieve folder object again to get the latest version (not currently being done)
  4. Make metadata changes to folder object
  5. Update folder

Here is a similar question that may help: The file * has been modified by SHAREPOINT\system

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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