Nintex Workflow 2010 “Failed to copy item. DocID: Site prefix not set.” Error

I created a Nintex Workflow 2010 workflow for a client that ended with the document set the workflow runs on being copied to another document library for archival.  The “Copy to SharePoint” action in Nintex is used in the workflow to accomplish the library copy.

I received the foll​owing error in the workflow upon trying to copy the document set to another library:

“Failed to copy item. DocID: Site prefix not set.”

After some investigation, I determined that the a site collection feature called “Document ID Service” needed to be activated in order to copy the document set to another library.  After activating the feature, the timer job that runs this service needs to run over night in order to accomplish its indexing.

The document set was succesfully copied to the archive library after retrying the workflow the next day.

3 thoughts on “Nintex Workflow 2010 “Failed to copy item. DocID: Site prefix not set.” Error

Add yours

  1. Hi!

    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
    $properties[“docid_msft_hier_siteprefix”] = “”

    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.

    1. sorry, correct code with an if:

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

      if ($properties[“docid_msft_hier_siteprefix”] -eq $null)
      $properties[“docid_msft_hier_siteprefix”] = “”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Website Powered by

Up ↑

%d bloggers like this: