Without going into too much detail, the compliance details page calculates the expiration date on the fly based on the ItemRetentionFormula for the item. The Expiration Date, however, is updated by an event receiver. This is why you have to run a SystemUpdate() on all documents after you enable retention policies.
I found that the event receivers were missing from these document libraries. How did this happen with a few of the documents having an Expiration Date? I don't know, but I do know how to add them back.
Luckily, adding the event receivers is very easy to do with a bit of code. For each of the event types you just have to run this code:
list.EventReceivers.Add(SPEventReceiverType.ItemAdded, "Microsoft.Office.Policy, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c", "Microsoft.Office.RecordsManagement.Internal.UpdateExpireDate");
Here's the entire piece of code that creates a command line tool to update a library
No comments:
Post a Comment