1

I am working on an issue tracking list inside SharePoint server 2013. And I have two columns as part of the list:-

  • Review Status. with these choices; New, in-progress, Need Review.
  • Review Date, of type Date only.

Now when an item is first created it will have its "Review Status" = "New", and its "Review Date" must be greater than current day.

now I am trying to implement this feature:- If "Review Date" is reached (“Review Date” = today), to automatically change the "Review Status" from “New” to “Need Review”?

Can anyone advice on the available approaches to achieve this ? is defining a workflow an approach to follow ?

2 Answers 2

1

If coding is option, Then you can create a timer job or console application and then schedule it to run daily. It will check whether today is review date and update the status accordingly.

The code will be something like below

using (SPSite site = new SPSite("Your site URL"))
{
    using (SPWeb myweb = site.OpenWeb())
    {
        SPList olist = myweb.Lists["Your list Name"];
        SPQuery query = new SPQuery();
        query.Query = "<Where><Eq><FieldRef Name='ReviewDate' /><Value Type='DateTime'><Today /></Value></Eq></Where>";
        SPListItemCollection olistitems = olist.GetItems(query);
        foreach (SPListItem item in olistitems)
        {
                //Update the item
                //Send the mail
        }
    }
}
8
  • @P thanks for your reply. yes coding is an option , but can you please advice what do you mean by console application?, are you talking about writing a powershell script and call this script on timely basis using task scheduler ?
    – John John
    Commented Feb 2, 2016 at 2:13
  • 1
    What i mean by console application is to write C# server side code and then run that application from SharePoint server. The application will have caml query which will you get the items for which review date as today. And then loop through those items, update that item and send mail. I have written such application and they worked perfectly.
    – P S
    Commented Feb 2, 2016 at 4:56
  • 1
    I have added code. This code you can add in timer job or console application. On how to create timer job or console application you can get articles on google.
    – P S
    Commented Feb 2, 2016 at 5:41
  • thanks a lot for your great reply. but what are the Pros and cons of writing a console application compared to write a powershell script , to achieve my requirements?
    – John John
    Commented Feb 2, 2016 at 11:34
  • 1
    If you have enterprise license of SharePoint, then yes retention policy also can be option. Here is article for birthday reminder, you can replace birthday date with review date and that will trigger workflow on review date: social.msdn.microsoft.com/Forums/sharepoint/en-US/…
    – P S
    Commented Feb 3, 2016 at 4:19
1

Using a workflow, you can set an action to Pause Until Date. In the date field, use your Review Date or a variable that is set to Review Date.

Basic workflow logic:

    Pause Until Review Date
    If Review Status = New
      Set Review Status = Review Needed

Little more info on the topic: "Pause until Date" workflows unable to handle changing dates?

1
  • thanks for the reply. but can you adivce on how will the Pause Until date work incase someone edit the Review Date field of an item,, will this update the Pause Until date of the current workflow or two workflows will be active in this case; one workflow with Pause until date = old Review date, while the other workflow will have Pause Until date = the updated Review date ?
    – John John
    Commented Jan 30, 2016 at 18:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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