开发者

How do you move a SharePoint 2010 DocumentSet from one list to another?

开发者 https://www.devze.com 2023-01-08 20:57 出处:网络
I\'ve tried many variations. Send To Library - That creates a Zipped file in the Drop Off Library, then it doesn\'t route via the rules in Content Organizer

I've tried many variations.

  1. Send To Library - That creates a Zipped file in the Drop Off Library, then it doesn't route via the rules in Content Organizer
  2. API - I've tried to do an Export, Import, but always receive the same error. This is per this MSDN documentation: http://msdn.microsoft.com/en-us/library/microsoft.off开发者_JS百科ice.documentmanagement.documentsets.documentset.create.aspx

Sample snippet:

byte[] exportedFile = set.Export();

DocumentSet.Import(exportedFile, DocSetNameToCreate, targetFolder, dsCt.Id, properties, web.CurrentUser);

Error Received:

DocID: Site prefix not set.


Finally got it to run. This is related to the Document ID Feature. Make sure it is activated in each site. Let is run over night (timer jobs need to run). Then the content organizer will successfully move and unpackage your document sets.


You don't have to activate the document id feature, just ensure that in the property bag of the root web of the destination site collection (where the document set will be imported again) exists a property named "docid_msft_hier_siteprefix" with an value of "" (empty string).

Use this powershell-script:

$site = Get-SPSite http://host/sites/yoursite
$properties = $site.RootWeb.Properties

if ($properties["docid_msft_hier_siteprefix"] -eq $null)
{
    $properties["docid_msft_hier_siteprefix"] = ""
    $properties.Update()
}

Note that i use the old property bag RootWeb.Properties instead of the new hashtable RootWeb.AllProperties, thats because the class Microsoft.Office.DocumentManagement.Internal.OobProvider still uses that.

So why is it failing when a document set is imported? The function DocumentSet.ImportProperties() catches an ArgumentException while trying to set the document id of the document set list item (so there's no problem if the document id column doesn't exist yet).

But they missed that the function OobProvider.GetSitePrefix() which is called through the function OobProvider.GenerateDocumentId() throws an InvalidOperationException if the property bag doesn't contain the prefix property.

0

精彩评论

暂无评论...
验证码 换一张
取 消