Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Automatically start SharePoint 2010 workflow based on document age

Posted on 2011-03-02
8
Medium Priority
?
1,209 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 32

Accepted Solution

by:
Jamie McAllister MVP earned 2000 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 44

Expert Comment

by:zephyr_hex (Megan)
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
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
LVL 32

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
 
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 32

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 32

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

886 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