Moving a file within a document library to a document set using MoveTo in an Item receiver not updating shared columns.
-
Wednesday, April 11, 2012 5:53 PM
My apologies for the long title and thank you for reading this..
I have tested and searched for the answer for far too long and want to see if others have experience this.
I have an event receiver setup on the ItemUpdated event so that when a file is uploaded to a document library the file name is checked and the file is moved to the appropriate document set. All of this works fine, and I am simply using MoveTo and building the url after checking for the appropriate document set name.
The issue i am having is once the file is moved it no longer responds to the Document Set field synchronization job. What i mean by this is once the document is moved to the document set, even if i manually run the Document Set field synchronization job the shared columns never update.
Yet, if i use the SendTo option or a workflow to move the file the Document Set field synchronization job will update the shared columns perfectly.
Any thoughts?
This is as simple as it gets:
oItem.File.MoveTo(url, true);
All Replies
-
Wednesday, April 11, 2012 6:47 PM
Have you tried to add the document with this approach,
Retrieve DocumentSet Object
spFiles = documnetset.Folder.Files
spFiles.Add(your file)
Rahul Gupta, MCPD - SharePoint 2010
-
Thursday, April 12, 2012 7:59 PM
I actually tried that as well with the same result (i tried CopyTo, Add, MoveTo). Here is an interesting note..could someone test this and see if it can be replicated?
I created a new library with a new document set with a single shared column. There are no event receivers or any custom code running on this library. I copied a single document into the root of the library in explorer view. Then, within Explorer View, i moved the document into the document set. I ran the document set sync job and the shared column did not update.
Yet, if i use SendTo or upload the file directly into the document set everything works fine.
Can someone reproduce this and are there any other suggestions? Thank you for the help so far!
-
Wednesday, April 25, 2012 1:15 PMAny thoughts on this one? Has anybody else found the same issue as I when moving a document as mentioned in my second post here?

