This article describes how to create a no code document expiry solution.
In this article, we tackle 2 main issues related to document expiry:
a. Notify users when a document is about to expire, e.g. send out a notification to the creator of the document 2 weeks prior to document expiration
b. On the expiry date of the document, send a notification email to the creator of the
document that informs the user their document has expired. The email should
have a link to the disposal workflow on it that allows the user to either
retain the document or delete the document.
Consider a Lease Document that is scheduled to expire on 15th December, 2011.
On 1st December, 2011, the creator of the document should receive a notification
email informing him \ her that the Lease Document is due to expire in 2 weeks.
On the 15th of December, the creator of the Lease Document should receive
another email informing him \ her that the document is expired. The latter
email should have a link to a disposal workflow that gives the creator of the
document the option to either retain or delete the document.
We solve the above issues using a combination of SharePoint Designer, Disposal Workflows and Tasks Lists.
Please note that in order to follow this solution, you need to add Expiry Date to the Default Document Content Type. I usually default the Expiry Date to [Today]+730 Days.
A. Notify users when a document is about to expire
1. Create a reusable workflow in SharePoint Designer 2010 called Document Expiry
Notification. The base content type for the reusable workflow should be the Default Document Content Type e.g. IKS Document
- The workflow should be created on the Root of the site
2. Configure the workflow as follows:
2.1 Add the Action: Add Time to Date
- Add (-14) days to the Current Item: Expiry Date, save the output to a new variable, Disposal Notification
2.2 Add the Action: Pause Until Date
- Pause until Variable: Disposal Notification
The configuration of the workflow should be as follows:
2.3 Add the Action: Send an Email
The configuration of the Email should be as follows (Feel free to modify the format of the email):
2.4 Check for errors. If not errors exist, publish the Workflow
3. Add the Workflow to Site Content Types
- Navigate to your Site Content Types (Site Actions -> Site Settings -> Content Types)
- Select the Default Document Content Type e.g. IKS Document
- Select Workflow Settings, and add the Document Expiry Notification Workflow
The Workflow Configuration Settings should be as follows:
- Add the workflow to all the Custom Document Content Types
B. Create a Disposal Workflow that assigns a task to the Creator of the Document
1. Create a Disposal Workflows Task List
1.1 Create a Task List and name it: Disposal Workflows Task List
1.2 Create an alert on the List targeted to all the Contributors of the appropriate Document
Library. Configure it to send alerts to the contributors every time a new item is added to the Task List.
C. Creating and Deploying the Notifcation WSP File
Please note that you could save the workflow as a template, solution file, in a .WSP format. This is helpful if you want to deploy the nofication workflow in various sites. To save the workflow as a .WSP file, navigate to the workflow in SharePoint Designer, and on the ribbon click on the “Save as Template” button.
This will save the workflow as a .WSP file. To add the WSP file, copy the file to the desktop of either your Web Front End or Application Server. Once it’s been copied rename it to “notification_workflow.wsp”.
Run the following PowerShell Command to add the WSP file:
Add-SPSolution -literalpath “C:\Users\Administrator\Desktop\Notification_Workflow.wsp”
*** Modify the path as required
You could deploy the WSP file from PowerShell or Central Administration. To deploy via Central Administration, navigate to Site Settings > Manage Farm Solutions and deploy the solution from there.
To deploy the solution from PowerShell type the following:
Install-SPSolution –Identity Notification_Workflow.wsp –WebApplication http://sp2010 -GACDeployment
*** Modify the Web Application URL
2. Create a Disposal Workflow
2.1 Navigate to the appropriate Document Library
2.2 Create a Disposal Approval Workflow
- Note that Disposal Approval Workflows are a Site Collection Feature that has to be
activated at the Site Collection Level
2.3 The Configuration of the Disposal Approval Workflow should be as follows:
The Disposal Approval Workflow will be kicked off by a retention policy. Therefore, ensure
that the Start on New Item Creation / Change are unchecked
3. Create a Retention Policy
3.1 Navigate to the Document Library Settings
3.2 Select the Information Management Policy Settings Option
3.3 Select the Content Type you want to Configure
- Please note that you will have to configure the retention for each Content Type separately
3.4 Select the Default Document Content Type e.g. IKS Document
3.5 Enable Retention by checking of the Enable Retention checkbox
- Add a policy that starts the Disposal Workflow after [Expiry Date + 0 days]
The configuration of the retention policy should be as follows:
3.6 Repeat steps 3.4-5 for all the desired content types e.g. Policies, Contracts, and Procedures etc.
Note that Disposal Workflows cannot be assigned to individuals or groups. Therefore, once you set up the disposal workflow and retention policy, there is an additional step necessary to actually receive emails from the workflow process.
I set up a simple alert on the task list that holds the tasks generated by the Disposal Workflow. Set is up to send an email to myself whenever a detail is changed.
*** Various customization options are available, we could set up a SPD workflow to compare the title of the Task to the title of the Document and send out an email to the person who created the Document.
3.7 Once a Document Expires, the Contributors receive the following email:
When users click on the: View Disposal Approval: Benefits Document. The following screen comes up.
The contributors can open the task directly from the email, in which case they open the Disposal
Workflow Directly and choose whether to Delete or Retain the Document. They can
also open the expired document from directly from the email and modify the
settings from the Document Information Panel (DIP)