0

I have created a document library which has a few documents in it.

I have created a list which has items with the same names as the document's in the document library, and there is a column called expiry in list.

Now my documents in document library has to be deleted once the expiry date is passed, how can this be done?

1

You can create a custom timer job in sharepoint that will scan the documents in that document library and delete the documents according to expiry date.

You can set the interval of the timer job as per your requirement.

To create timer jobs you can check:

http://www.codeproject.com/Tips/634208/Create-and-Deploy-Custom-Timer-Job-Definition-in-S

0

As always there's multiple options:

Retention Policy
If the expiry column had been on the document library itself and you're using SharePoint Server, then the right way to do this would be to specify a Retention Policy see: Applying Document Retention in SharePoint 2010

Timer Job
A nightly timejob as described by @user2861804 could do the job.

Workflow
A workflow could be set to Wait until Expiry and then delete the document.

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.