Skip to main content

Hi,

I have this situation, where I need to have a calculated field that shows "number of days delayed". The basic formula is something like "today - deadline".

Since it is not possible to use [Today] or TODAY() in a calculated column (well - TODAY() can be used, but tomorrow the value will be yesterday unless the item is updated, since calculated fields are only recalculated when an item is update - doh!).

One way out of this missery could be to have a workflow make an update to all items in the list right after midnight.

Untitled.png

So far so good - that works.

However: I really don't like that the item history has the noise from the workflow in it. I would still very much like "Modified" and "Modified by" to reflect the last "real" update that was made to the item - not this workflow update, which is just a workaround to Sharepoint not suporting dynamic timestamps in calculated fields. In fact no fields are actually updated on the item itself as you can see in the screenshot (Field = None).

Any ideas on how to overcome this?

Regards

Leif

you will have to tweak it with sharepoint

Dynamically Updating a SharePoint Calculated Column Containing a “Today” Reference | NothingButSharePoint.com

How to keep SharePoint calculated columns up-to-date | SharePoint Pros


Hi Marian,

Perfect - I tried the solution in your second link (How to keep SharePoint calculated columns up-to-date | SharePoint Pros). I had to modify the script only a little bit to achive the "anonymous" update effect that I was after:

$spWeb = Get-SPWeb -Identity http://server/subsite

$spList = $spWeb.Lists["Display_list_name"]

$spList.Items | ForEach-Object { $_.SystemUpdate() }

I changed $_.Update() to $_.SystemUpdate inspired by the info in your first link happy.png

Thanks a lot for input.

Regards

Leif


Reply