0

I'm using sharepoint 2007 and my requirement is to have an email sent to a user should it reach a certain date of the month and the user hasn't updated a list item.

So the way it currently works is that a user submits a form and I have a workflow which creates a document which the users manager needs to fill out by the end of the month. I am creating a workflow which will check a list item to see if it's updated and if not I want it to send an email. My issue is timing; the form can be submitted at any time of the month, however they will be reviewed and cleared on a monthly basis. I want my workflow to check the list item 5 days before the end of the month (month on month) and send a reminder mail if not completed but I can't figure out how to identify the end of the month in a variable to create a workflow step.

Eg. If the user submitted the form on 2nd of April, I want to start a workflow to check for completion on 26th of April. If they submit it on 10th of May, I want my workflow to check for completed on the 27th of May etc. Always 5 days before the end of the month it was submitted during.

Am I missing something very easy? Everything that I search is based on date calculations, ie. +30 days but in my scenario it's dependent on a recurring monthly date, not a specific amount of time.

Thanks in advance for any help anyone can offer.

0

I would use (timer) job which would run (every day) only on specific date (5 days before month ends) check for running workflows in specific list/library/site. If any WFis running -> get WF item and send email to approver.

  • Hi Luccio, thanks for your answer. The problem I'm having though is how to identify the end of the month? Is there a formula or something that I could use that would output the last date of the current month? – Jamie Apr 16 '14 at 13:10
  • Can't you just run job every day and as the first thing check the date? I use this approach sometimes in SP2010 and Timer jobs. – luccio Apr 16 '14 at 13:18
  • I can run a job every day but how will the job know what's the right date as it will change each month. I need it to check lastdayofmonth and then subtract 5. I just don't know how to identify lastdayofmonth – Jamie Apr 16 '14 at 13:53
  • var date = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); date = date.AddMonths(1); var lastDateOfTheMonth = date.AddDays(-1); Or even easier => DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month); – luccio Apr 16 '14 at 13:58
  • I'm stuck as to where to put that code? It doesn't work within a workflow does it? – Jamie Apr 16 '14 at 14:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.