Make a calculated field of each Sharepoint list item update

k_harpaul
k_harpaul used Ask the Experts™
on
Hi.

I have a SharePoint list where a person can add information. In one of the fields the user enters a date. We can call this field "Capture Date". I would like to add another field (we can call this "Days In Progress") that calculates the number of days that has passed since the capture date was entered. IE: "Current Date-Capture Date". I would this field to be dynamic.

The problem that I have is that the "Current Date" does not change everyday unless an item is edited. I did have a look on this website and a similar question was posted before. The url is: "http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/MS-SharePoint/Q_24086473.html"

Is there a way that this can be done? I am open to any solution even Workflows or adding a refresh button somewhere that will update all items in the list to that I get a correct "Days in Progress".

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Rajendra ShekhawatSolution Architect

Commented:

Hi,

Please look at following article, when author has suggested 2 alternates to the SharePoint product calculated column problem - http://vspug.com/dez/2008/07/31/dynamically-updating-a-sharepoint-calculated-column-containing-a-quot-today-quot-reference/

Another option, I can think of is to write a custom timer job with custom c# code to update the listitems. Timer job can be scheduled as per your requirements to column updation.

I hope it helps.

Cheers ...
Rajendra

Author

Commented:
Hi.

The above solution requires editing the web.config file. Is there another way I can do it without editing the web.config file.
Rajendra ShekhawatSolution Architect

Commented:

Hi,

Option 1 ( http://vspug.com/dez/2008/07/31/dynamically-updating-a-sharepoint-calculated-column-containing-a-quot-today-quot-reference/ ) - Console application added as a “Scheduled Task” in Windows. It is about creating a console application with the custom code to update calculated columns. And then scheduling it. It doesn't require changes in web.config.

Option 3 - Create SharePoit timer job with the custom code to update calculated columns. It also doesn't require web.config changes. Advantage of this solution is that SharePoint takes care of running and maintenance of timer jobs.

I hope it helps.

Cheers ...
Rajendra Shekhawat

Author

Commented:
Hi.

Sorry, I also forgot to mention that I don't have access to the server itself. I have full admin rights on the site. Can it be done?

Regards,
Kritesh.
Solution Architect
Commented:

Hi,

Option 3 - Creating SharePoint timer job looks appropriate for you. You can write custom c# sharepoint timer job, having code to update calculated columns. Create the wsp package for the timerjob and give it to the administrator to deploy it on the server.

Please look at following links for references on timer jobs and creating wsp package to deploy timer jobs -

http://www.andrewconnell.com/blog/articles/CreatingCustomSharePointTimerJobs.aspx
http://snahta.blogspot.com/2010/05/sharepoint-timer-job-vs-windows-task.html
http://akshaya-m.blogspot.com/2009/08/sharepoint-time-jobscheduler.html

I hope it helps.

Cheers.
Rajendra Shekhawat

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial