1

I want to create a timer job in sharepoint 2013, the purpose of the timer job, is to loop through my list items and do these two actions:-

  • Check if the "Review Date" of an item is met (Review date = today), and if so, to chnage the item status to be "In Progress".

  • then to send an email to the "Assigned To" user , that there is an item with Review Date that have been met.

Now i read many articles about performing similar background tasks in SharePoint 2013 , and i seattle on using Timer Jobs , and i find a link which talk about this.

but seems all the articles are creating farm solution to create a timer jobs. but my question is if using Farm solutions in SharePoint 2013 is considered a deprecated approach as mentioned in these links :-

https://msdn.microsoft.com/en-us/library/office/jj163902.aspx & https://msdn.microsoft.com/en-us/library/office/jj163902.aspx?f=255&MSPPError=-2147217396

so not sure how i should create my timer job in SharePoint 2013?

EDIT

now i am using workflow 2010 inside SharePoint designer 2013. so i am planning to do the following steps to implement my retention policy :-

  • using SharePoint designer 2013 i will create & publish a reusable 2010 workflow as follow, where i will be checking if the "Review Date" = today & Status = "Active", then to update the item status and send an email:-

    enter image description here

  • then i will go to site collection settings >> content type >> and i will associate the above workflow with the content type.

  • after that on the content type i will set a retention policy as follow:-

enter image description here

mainly it will first run when an item is created (created date + 0 day), then i set it to run a workflow , and i set the recurrence to be each day.

  • final step is to set the related timer jobs ("Information management policy" and "Expiration policy") to run daily as they are configured to run weekly.

so can you adivce on these points please:-

  1. is my approach for creating the above retention policy valid ?

  2. Although i am using workflow 2010 , but do you have any idea why workflow 2013 does not work with retention ? is this a imitation in workflow 2013 ? or there is another reason ?

Thanks

  • 1. Looks like it is fine.. If it is available in the drop down to select the workflow it should run according to the timer job. 2. My understanding is that in 2013 WF have been separated from the platform (hence the workflow manager) so several things have changed due to different permissions – Roland Feb 3 '16 at 3:11
  • @Roland but in my case there is not any issue of using workflow 2010 , inside the retention policy.?? – john Gu Feb 3 '16 at 12:32
  • I assume by not any issue you mean there is an issue (it doesn't appear?) It may be due to it being a site workflow and not a list workflow. – Roland Feb 3 '16 at 23:22
2

Farm solutions are only unavailable if SharePoint Online is a consideration. SharePoint 2016 continues to fully support not only custom Timer Jobs, but Full Trust Code Solutions, as well. I feel that FTC solutions should be used when and where appropriate for customers who continue to use SharePoint On-Prem.

If you can find alternative solutions that do not require FTC, that's ideal. As a sysadmin-focused solution, one might look into creating a PowerShell script that replicates the functionality and run it as a Scheduled Task on a SharePoint server.

  • thanks for your reply, now we are using On-Prem SharePoint server 2013. so which approach will be more appropriate in my case ; to create a timer job or to create a powershell script which will be called on timely basis from the task scheduler ? i find that using timer job will be more SharePoint-oriented solution as the timer job will be inside the SharePoint farm itself, rather than being an external resource ,, but not sure what are the other differences between having my logic as timer job or as a power-shell script,, can you advice please ? – john Gu Feb 2 '16 at 1:02
  • 1
    SharePoint already has this capability inbuilt. Look at retention (list settings> Info management policy settings) allows you to run a 2010 WF in 2013. Runs baised on an existing timer job. – Roland Feb 2 '16 at 3:06
  • @Roland can you please advice more on your point ? – john Gu Feb 2 '16 at 11:30
  • @Roland so do you prefer to define a workflow which will check the Review Date then send an email and update the list items when applicable. then to set a Re-tension Policy which run once a day , and set this retention policy to call the workflow – john Gu Feb 2 '16 at 17:52
  • 1
    Yes I prefer using a workflow as 1.It is very quick to edit and 2. You don't need to create anther timer job that does the same thing as the current job. Please note that the retention in 2013 will only run 2010 WF – Roland Feb 2 '16 at 22:59

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.