SharePoint Information Management Policy: Invalid field name.


One of our projects makes use of Information Management Policies in SharePoint Server. We were programmatically adding these policies to Content Types, but for some reason this didn’t work when we migrated the application to SharePoint 2010.

Issue

We receive the following error:

System.ArgumentException: Invalid field name. {b0227f1a-b179-4d45-855b-a18f03706bcb} http://intranet 
   at Microsoft.SharePoint.SPFieldCollection.GetFieldById(Guid fieldId, Boolean bThrowException)
   at Microsoft.SharePoint.SPFieldCollection.get_Item(Guid id)
   at Microsoft.Office.RecordsManagement.InformationPolicy.Policy.EnsurePolicyFields(SPContentType ct)
   at Microsoft.Office.RecordsManagement.InformationPolicy.Policy.CreatePolicy(SPContentType ct, Policy globalPolicy)
   at VNTG.Initialisation.AddVersionLabelToContentType(SPContentType ctype)

If you dig deeper on that Field ID you quickly find that it’s the _dlc_Exempt field, one of the system fields for Policies.

At first we manually added them to our Content Types, but that didn’t feel right. It fixes the issue and allows you to work with the Content Type, but as soon as you start adding them to document libraries you’ll see strange things appearing. Fields are listed twice or missing in the List Content Type view, etc.

Solution

No need to manually start adding hidden system fields to your content types, just enable the “SharePoint Server Standard Site Collection features” feature on the Site Collection.

 


Links to this post

Comments

Tuesday, 25 Oct 2016 12:01 by Jay
We've got this same problem.... but, the SharePointServer Standard Site Collection Features is already enabled. Is this something that somehow could "look" enabled, but not be?

Wednesday, 26 Oct 2016 09:50 by Steven Van de Craen
Definitely, try reactivating the feature and see if that changes anything. Is it the same field that's causing your issue? If it's a different one then this may not apply to your situation.

Wednesday, 26 Oct 2016 04:53 by Jay
It is the same field. My worry is on a production server...what's the risk of turning the feature on and off. It's a fairly substantial one and I'm worried about taking something else out. is there a way via powershell to "enable" the individual components of the feature, or check to see their condition before just throwing the switch? Thanks :)

Wednesday, 26 Oct 2016 07:36 by Steven Van de Craen
Hi, the risk should be small, but I'd recommend doing it off hours so no users are actively working/impacted. I don't have an environment at hand to check your other questions. If you have a non-prod environment you can always test the procedure.

Friday, 28 Oct 2016 09:31 by Jay
An update. I got the feature working again by finding the actual feature that does Information Management policies, confirming it was supposedly enabled, and then i disabled it and reenabled it again. The feature is RecordResources. I ran get-spfeature recordresources -Site "http://www.domain.com" and confirmed SP thought it was enabled, I then ran Disable-SPFeature recordresources -URL "http://www.domain.com/" to kill it (this will ask for confirmation) Finally, I ran Enable-SPFeature recordresources -URL "http://www.domain.com/" and low and behold i was operational.

Sunday, 30 Oct 2016 06:08 by Steven Van de Craen
Great info! Thanks for sharing!

CAPTCHA Image Validation