1

In SharePoint 2013 List A, I want to refresh value of column A of all items, but I don't want to make new item version when I do refreshing/update.
Column A is calculated column and it is calculating difference in time between Now() and some other date column. So it would display correct value only if user manually edit item.

I found PowerShell script that updates column A, but it will leave new item version, any chance to suggest me how can I modify it so Items won't be updated?

$web = Get-SPWeb http://Server/ListLocation
$list = $web.Lists["ListA"]

foreach ($item in $list.Items)
{
  $item.Update();
}
  • SPOnline added a SystemUpdate.. Are you the Formulas only for display? Or does its value trigger other Formulas or Workflows? – Danny '365CSI' Engelman Apr 10 '17 at 9:24
  • That column A will later be used for additional calculations. – Danilo Apr 10 '17 at 9:27
  • Then all Front-End only solutions do not apply – Danny '365CSI' Engelman Apr 10 '17 at 10:16
2

Try below code:

$web = Get-SPWeb http://Server/ListLocation
$list = $web.Lists["ListA"]

foreach ($item in $list.Items)
{
  $item.UpdateOverwriteVersion();
}

Reference - UpdateOverwriteVersion

You can also use:

item.SystemUpdate();

difference -

UpdateOverwriteVersion() - updates the list item without creating a new version, but the Modified and Modified By fields are also updated.

SystemUpdate() - updates the list item without creating a new version,also the fields Modified and Modified By are not updated.

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.