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:
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:
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:
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.
This was an issue we found in one of our SharePoint 2013 projects.
With special thanks to Matt Connolly who points me in the right direction.