SharePoint Blogs / SharePoint University
SharePoint Blogs and SharePoint University - all in one place!
Need SharePoint Training? Attend a SharePoint Bootcamp!

Please delete cookies related to sharepointblogs.com and sharepointu.com to resolve login issues!

Using workflow and policies to view only certain list items

Recently, I received an intriguing question from a client of ours.

They have a document library with a lot of project documents, mainly meeting agendas and minutes, but some other important documents as well. Now what they would like is filtering out the older agendas and minutes, but not all the other document types. So just setting a Filter in a List View won’t do it. Here’s what you should do:

I assume you already have some kind of Document Type Column in your document library, to differentiate the types of document you use. I have named this column DocumentType and I have four types of documents: Action Plan, Agenda, Business Case, and Minutes. Now I only want to see the Agendas and Minutes from the past two months, and the Action Plan and Business Case.

  1. In the Document Library, create a new Column to store some kind of flag which we can use to filter documents on in our View. I created an Archive column of type Yes/No, default No.


  2. Next, create a new workflow with SharePoint Designer. I called it “Set Archive Status to Yes”. Make sure you enable the “Allow this workflow to be manually started from an item” option and disable the other two start options. Click Next. Choose the Document Types you would like to set the Archive flag for in the Conditions part, and set the Archive flag in the Actions part.


  3. Finally, you have to create a policy on the document library, to call the workflow you just created. Go to you Document Library settings, and click the “Information management policy settings” link. Choose “Define a policy…” and click OK. Enable Expiration, choose the time period after which you would like to execute your workflow and select the workflow you created under step 2.

Voilà, you’re done! Of course you would have to modify your list view to filter out the documents with Archive set to No.


Posted 07-30-2007 11:04 AM by Maarten Eekels

Comments

9 Links Today (2007-07-30) wrote 9 Links Today (2007-07-30)
on 07-30-2007 10:25 AM

Pingback from  9 Links Today (2007-07-30)

ken wrote re: Using workflow and policies to view only certain list items
on 12-16-2007 9:21 PM

HI, I do this but have a error

the workflow can't be start (Failed on Start (retrying))

error message :

12/15/2007 23:21:52.86 OWSTIMER.EXE (0x21A0)                   0x1CA0 Windows SharePoint Services   Workflow Infrastructure       98d7 Unexpected System.ArgumentException: Value does not fall within the expected range.     at Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties..ctor(SPWorkflow workflow, Int32 runAsUserId, String associationData, String initiationData)     at Microsoft.SharePoint.Workflow.SPWinOEWSSService.MakeActivation(SPWorkflow workflow, SPWorkflowEvent e)     at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(Guid trackingId, SPWorkflowHostService host, SPWorkflow workflow, Collection`1 events, TimeSpan timeOut)     at Microsoft.SharePoint.Workflow.SPWorkflowManager.RunWorkflowElev(SPWorkflow originalWorkflow, SPWorkflow workflow, Collection`1 events, SPRunWorkflowOptions runOptions)

12/15/2007 23:21:53.10 OWSTIMER.EXE (0x21A0)                   0x1CA0 Windows SharePoint Services   Workflow Infrastructure       72fs Unexpected RunWorkflow: System.ArgumentException: Value does not fall within the expected range.     at Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties..ctor(SPWorkflow workflow, Int32 runAsUserId, String associationData, String initiationData)     at Microsoft.SharePoint.Workflow.SPWinOEWSSService.MakeActivation(SPWorkflow workflow, SPWorkflowEvent e)     at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(Guid trackingId, SPWorkflowHostService host, SPWorkflow workflow, Collection`1 events, TimeSpan timeOut)     at Microsoft.SharePoint.Workflow.SPWorkflowManager.RunWorkflowElev(SPWorkflow originalWorkflow, SPWorkflow workflow, Collection`1 events, SPRunWorkflowOptions runOptions)

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Need SharePoint Training? Attend a SharePoint Bootcamp!
Posts (c) their respective authors. Everything else (c) 2009 SharePoint Experts, Inc.