Skip to main content

Cloud

Set up Document ID prefix in SharePoint 2013 programmatically

While it is simple to set the prefix of Document ID Service in SharePoint 2013 manually, it’s less straightforward if you are looking to set it up programmatically (but still fairly simple once you know how). If you’ve been wondering how to do this correctly, last week, Perficient’s Peng Zhao wrote a blog post that walks through the necessary steps.

This post introduces you to a correct way to set up Document ID Prefix in SharePoint 2013. Immediately after you kick off the timer jobs for Document ID service in this approach, all of your documents under the new site will show up with correct prefix.
We have recently rolled out a web template based on our team site template. It requires you to set the prefix of Document ID service when the user is creating a site with the web template. It is simple if you can do it manually in the “site settings>>Document Id Settings” like this:
SharePoint2013 Document ID Settings
If you plan to do it programmatically, it is a different story. The articles or blogs I searched on the Internet demonstrate that the following will do the trick:
SharePoint2013 Document ID Settings by web properties
It sets the root web property “docid_settings_ui”. It also sets the prefix value on the Document ID Settings page as if it were set manually. If you go to the settings page, the prefix string shows up there; nothing seems wrong. But after you kick off your timer jobs for Document ID service, you will find all your documents never get the new prefix.
The CORRECT way to set the document id prefix should be like this:
SharePoint2013 Document ID Settings by server side model
Neat and simple, right?
In this way, right after you kick off the timer jobs for Document ID service, all your documents under the new site will show up with correct prefix.
 

Thanks Peng Zhao and Matt Connolly for sharing this tip!

Thoughts on “Set up Document ID prefix in SharePoint 2013 programmatically”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Taylor Rhyne

I work closely with our content management practices and partners at Perficient to lead marketing efforts designed to increase awareness and impact pipeline. I have experience in a variety of industries and have spent the last decade creating multi-faceted campaigns, working to integrate various channels into the plan and maximize effectiveness.

More from this Author

Follow Us
TwitterLinkedinFacebookYoutubeInstagram