Link to home
Start Free TrialLog in
Avatar of ICG
ICGFlag for United States of America

asked on

Automatically start SharePoint 2010 workflow based on document age

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!
ASKER CERTIFIED SOLUTION
Avatar of Jamie McAllister
Jamie McAllister
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Why don't you create a timer job which check the dates on a daily basis?
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/
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.
Avatar of ICG

ASKER

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?
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.
Avatar of ICG

ASKER

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