Setting default value of document library column using powershell

Created document library based on template which is using custom content type containing managed metadata based column.

I can upload documents. Everything looks normal except when I visit Column default value settings page in DL settings, I get error message below

Application error when access /_layouts/15/ColumnDefaults.aspx, Error=Value does not fall within the expected range.   at Microsoft.SharePoint.SPWeb.GetWebRelativeUrlFromUrl(String strUrl, Boolean includeQueryString, Boolean canonicalizeUrl)     at Microsoft.Office.Server.WebControls.MetaDataNavTree.TreeViewDataBound(Object sender, EventArgs e)     at System.Web.UI.WebControls.HierarchicalDataBoundControl.PerformSelect()     at Microsoft.Office.DocumentManagement.MetadataNavigation.MetadataNavigationContext.OnTreeViewLoad(SPTreeView spTreeView)     at Microsoft.Office.Server.WebControls.MetaDataNavTree.PerLocationPageLoad()     at Microsoft.Office.DocumentManagement.Pages.ColumnDefaultsPage.OnLoad(EventArgs e)     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Page.ProcessRe...  6bf73b9c-e4f3-10ae-0f74-9672cdd9936f

I tried many things but nothing seems to work. When I create document library using SharePoint OOB template, everything works.

Any help would be appreciated.

Thanks.


  • Edited by Adhanj Saturday, August 24, 2013 5:36 AM
August 23rd, 2013 11:40pm

I think so problem with managed metadata services or column..

Can you tell more about it..

What is the column name or type..

Free Windows Admin Tool Kit Click here and download it now
August 24th, 2013 8:37am

How many metadata columns does your content type have?
If more than 8 (max default), you will have to raise the "List View Lookup Threshold" value in the "Resource Throttling" settings of the web application.
August 25th, 2013 12:34pm

One managed metadata column.

Yogesh, I think the problem is with managed metadata service or column.

It doesn't seem to happen in our production environment. We restored test database from production database first time and experiencing random errors and issues.

Wondering if there is any way to debug it. Is there any option to configure SP 2013 to debug mode.

Free Windows Admin Tool Kit Click here and download it now
August 26th, 2013 3:57pm

Did you restore your metadata service database from production as well? those will have to match up with the id's etc. of the columns and data that each is using.
August 26th, 2013 6:18pm

Yup, it seems like the restore from production caused it.
Free Windows Admin Tool Kit Click here and download it now
September 20th, 2013 10:39pm

Not sure if anyone is still running into this error but figured I'd share what I have found.  I tried using powershell to delete the column default value settings for the list, and I received an access denied error to a file in the list under "{List Name}/Forms/client_LocationBasedDefaults.html".  All of my libraries that were working did not have this file, so I used SharePoint designer to delete the file in the affected list, and I no longer get the error message.  I do not know why/how this file was generated, but it contains the default value settings in html format.  

Hope this info helps someone out there!

June 19th, 2014 6:18pm

I found another way to fix this. Thanks to you pointing me to the file "{List Name}/Forms/client_LocationBasedDefaults.html" I found the difference between this file and the one of a list that worked:

I had "&" in the names of some folders. The recreated subsites from a template that contained such folders in the document library had the problem descriped by the OP. In the recreated client_LocationBasedDefaults.html there were actual '&' in the folder names instead of '%26' escape characters. After replacing those characters with their escaped version everything worked as expected again.

Free Windows Admin Tool Kit Click here and download it now
April 7th, 2015 7:28pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics