0

I have a list of our clients and a column with the last time we visited them, I would like to create a workflow that calculates how many days have passed based on the last visit date

I had a calculated column but that only updated when the item was created or edited, I need it to update every day without editing the item to trigger the change.

Any help would be great

Thanks

  • Can you use server-side code? If so, I would recomend writing a custom timer job. – Slaven Semper Nov 23 '14 at 17:28
  • Can you please explain further what i will need to do to create a custom timer job and the code needed to make it work. Thanks – Matt Saunders Nov 23 '14 at 22:47
0

I recommend implementing a custom timer job in SharePoint because it solves your request in a best way.

Since description of creating a custom timer job is a bit lengthy, and resources already exist with detailed steps, I am providing you with a link: http://www.codeproject.com/Tips/634208/Create-and-Deploy-Custom-Timer-Job-Definition-in-S. Once you have it up and running the rest is easy.

Timer jobs have configurable schedule so you can run it, for example, every day at specified time.

  • I've just read the top of the article and that timer job will do the following, Execute a code in SharePoint at every 15 minutes and adds a new record to the Task list. I need it to work out the days since the last visit column – Matt Saunders Nov 24 '14 at 20:17
  • The idea is to write a timer job which runs on daily basis. Each day timer job will read last visit date and then subtract it from DateTime.Now. This will give you number of days which have passed from last visit date. Then you can store the result in a new column. – Slaven Semper Nov 24 '14 at 20:41
  • OK great, what code will I need to make all that work in the timer job? – Matt Saunders Nov 25 '14 at 21:21

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.