Solved

Automatically start SharePoint 2010 workflow based on document age

Posted on 2011-03-02
8
1,161 Views
Last Modified: 2012-05-11
We have a document library consisting of resumes of our consultants; all are Word documents. Can we build a workflow in SharePoint Designer 2010 that looks at the 'last modified' date of each document and if it is longer than six months, email the owner of that document?

I have built a few other workflows across our SharePoint 2010 platform but all of them start when a document is added or modified; I'm not sure how to configure a workflow like this to automatically run and watch the dates.

Thanks!
0
Comment
Question by:ICG
8 Comments
 
LVL 31

Accepted Solution

by:
Jamie McAllister MVP earned 500 total points
ID: 35018802
You might be better off introducing a Delay activity in the WF that resumes the WF six months after the document has been added.

So the WF starts when the document is added, pauses for 6 months with the delay activity, and then re-hydrates and performs the final necessary actions.
0
 
LVL 6

Expert Comment

by:psv1973
ID: 35019081
Why don't you create a timer job which check the dates on a daily basis?
0
 
LVL 42

Expert Comment

by:zephyr_hex
ID: 35019169
i concur with the custom timer job method.

if you delay a WF for 6months, it's actually in a partial running state... like "pause", which means it's using resources.  custom timer job would trigger when it's time to run, so there are no wasted resources.
http://dotnetfinder.wordpress.com/2010/07/24/creatingcustomsharepointtimerjob2010/
and more info here:
http://platinumdogs.wordpress.com/2010/05/05/sharepoint-developing-custom-timer-jobs/
0
 
LVL 31

Expert Comment

by:Jamie McAllister MVP
ID: 35019215
Actually the WF gets dehydrated - i.e. serialized to XML and a built in timer job polls to see whether the WF should be rehydrated and resumed. In no sense is the WF hanging around in RAM using resources. The timer job that polls dehydrated WF runs anyway whether you use Delay activities or not.

Timer Job = custom development whereas the questioner mentions SPD 2010.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 1

Author Comment

by:ICG
ID: 35019658
Thanks for the ideas!

Related question; within this same workflow: we have managed metadata columns in this list. For each resume, there is a column displaying who's resume it is and another column displaying the employee type (W2 or 1099). I would only like this workflow to apply to W2 employee's so I am setting up the workflow to terminate itself if the data in the employee type column DOES NOT equal W2.

Whenever I perform a lookup on the EE Type column, it returns the EE type plus a long string as shown below:

W2|9cde55d2-8823-4cf9-abe5-fff02c583435

Same for the employee name column, it returns:

(ee name here)|9cde55d2-8823-4cf9-abe5-fff02c583435

Is there a reason for it append the extra string?
0
 
LVL 31

Expert Comment

by:Jamie McAllister MVP
ID: 35019817
You're seeing the raw value of the managed metadata value. The first part is the bit visible in the UI and the second is the underlying identifier. A lot of fields in SharePoint are like this. Use a string function to split on the vertical bar if you need to.
0
 
LVL 1

Author Comment

by:ICG
ID: 35019858
Is that a built in option with SPD?

I see these options:

Extract Substring from Start of String
Extract Substring from End of String

Both of these seems to only allow you to extract a specific number of characters from the string.
0
 
LVL 31

Expert Comment

by:Jamie McAllister MVP
ID: 35020447
You're right. It's possible to extend the functions.

This project on Codeplex gives the string functions you need to do this;

http://spdwfstringactions.codeplex.com/

No Split, but it has IndexOf and Substring which will do the trick.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

If you create your solutions on SharePoint sooner or later you will come upon a request to set  permissions of the item depending on some of the item's meta-data - the author, people assigned as approvers, divisions, categories etc. The most natu…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now