Records Center “Generate a File Plan Report” link produces an error

Within a Records Center under Site Settings -> Manage Records Center, there is a link on the right hand side titled “Generate a file plan report”.

RecordsCenterGenerateFilePlan

When clicking on this, I was seeing either the standard correlation Id error dialog or a yellow screen of death. The following error appears in the ULS:

05/21/2013 13:10:36.16 	w3wp.exe (0x0980)                       	0x1234	SharePoint Foundation         	Runtime                       	tkau	Unexpected	System.NullReferenceException: Object reference not set to an instance of an object.    at Microsoft.Office.RecordsManagement.Reporting.ApplicationPages.CustomizeReport.OnLoad(EventArgs e)     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)	d5512f59-3bcc-4a67-be69-62530115a064
05/21/2013 13:10:36.23 	w3wp.exe (0x0980)                       	0x1234	SharePoint Foundation         	Monitoring                    	b4ly	Medium  	Leaving Monitored Scope (Request (GET:http://webapp1:80/sites/rc/_layouts/customizereport.aspx?Category=FilePlan&backtype=list&List=)). Execution Time=145.0229

You’ll also notice that in the URL as well as the above ULS log, that the List parameter is blank. There are two Javascript functions that get executed when clicking on the link, the first function calls the second function to retrieve the List Name based on a resource:

<...>
	  function getFilePlanReportLink()
	  {ULSs5K:;
		  var listGuid = "<%= getRecordListID() %>";
		  var serverRelativeUrl = "<%= SPContext.Current.Web.ServerRelativeUrl %>";
		  if (serverRelativeUrl.length >= 1 && serverRelativeUrl.charAt(serverRelativeUrl.length - 1) != "/")
		  {
			  serverRelativeUrl += "/";
		  }
		  if(listGuid != "" || listGuid != null)
		  {
			  return STSNavigate(serverRelativeUrl + "_layouts/customizereport.aspx?Category=FilePlan&backtype=list&List=" + listGuid);
		  }
		  return STSNavigate(serverRelativeUrl + "_layouts/create.aspx");
</...>

<...>
		protected string getRecordListID()
		{
			string listGuid = string.Empty;
			SPWeb web = SPContext.Current.Web;
			string recordsUrlResourceString = "$Resources:dlccore,RecordsLib_ListFolder;";
			string recordsListUrlName = SPUtility.GetLocalizedString(recordsUrlResourceString, null , web.Language);
			try
			{
				SPList list = web.GetList(SPUrlUtility.CombineUrl(web.ServerRelativeUrl, recordsListUrlName));
				if(list != null)
					listGuid = list.ID.ToString();
			}
			catch { }
			return listGuid;
		}
</...>

The intent is to look for a Record Library with the internal name of “Records” and pass the library’s Guid in this function.

To fix this error, on the Records Center site, simply create a new Record Library name “Records”.

RecordLibrary

Once the library is created, the Generate a File Plan Report link will work on the Manage Records Center page.

Trevor Seward is a Microsoft Office Apps and Services MVP who specializes in SharePoint Server administration, hybrid scenarios, and SharePoint Online. He has been working with SharePoint for 16 years from SharePoint 2003 on up, managing environments with terabytes of content for 150,000+ user organizations. Trevor is an author of Deploying SharePoint 2016 and Deploying SharePoint 2019. You can find him on Twitter and in /r/sharepoint.