0

Sharepoint 2013, on-premise, we provision a document library declaratively using a sandbox solution.

How can we - in the declaration - add a simple retention policy (Information Management Policy Settings) to delete files after 30 days of creation?

Is this even possible or does one need to resort to event receivers on creating an instance of the library?

0

This is pretty straightforward. Follow these steps

Go to the Library settings ---> Information Management and Policy settings ---> Source of retention for this policy --->Change this from ContentType to Library and Folders ---> Add a retention Stage

Now speicy what casues the stage to activate ---> in your case it will be "Time Period".

Set it to created plus 30 days .Click on okay .

Most important after this you need to schedule 2 timer jobs . One is "Information Management Policy" --> this job reads your retention policies.

Second one is "Expiration Policy" --> this job deletes files according to your retention policy..

Revert if this does not help you.

  • Hi Yash thanks for the answer, however, I know how to do this manually, but want to provision a library content type that already comes with this setting. So either some declaration in schema.xml? or if not possible otherwise with an event receiver? - BTW: I updated my question to make it clear that I want to programmatically provision the retention policy – Juergen Riemer Oct 19 '18 at 8:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.