In a SharePoint library (SharePoint 2013, but it might also the case in SharePoint 2010 and SharePoint Online) it is possible to declare items as records. This might be done by the user, or by code. In the same library more elements than the threshold limit are stored.

When a folder in this library should be deleted (yes, the folder is empty), a message states that the “Folder cannot be removed because it contains items which are either on hold or declared as records”.

To be able to remove the folder the hidden column “Hold and Record Status” (internal name “_vti_ItemHoldRecordStatus”) must be indexed. If a list or library is defined by code or a SharePoint feature, add this column to the schema.xml of the list or library.