I’m trying to update some items in a list and I’m using systemUpdate in my PowerShell to do the update so that workflows and event handlers aren’t kicking off.

$item.SystemUpdate()

For some of the items I’m getting the following error:

Exception calling “SystemUpdate” with “0” argument(s): “The file <filename> has been modified by DOMAIN\Username on <date>”

When I run the same script with a $item.Update() rather than a SystemUpdate all works fine. However this will get a lot of the workflows started. so update is not an option.

Then I tried the SystemUpdate again and it just worked. Hmm, this looks a bit inconsistent.

So how can we make this work better? I can see two options:

1. Collect the error and retry the SystemUpdate when it fails.

2. Collect the error and try the Update when it fails. (accept that workflows migth kick off for this one item

 

I also had a look into the SystemUpdate command and there is a second version of the same command.

$item.SystemUpdate(boolean)

According to this article:

https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-server/ms479448(v=office.15)?redirectedfrom=MSDN

Updates the database with changes that are made to the list item without changing the Modified or Modified By fields, or optionally, the item version. 

There is only a small difference between the two versions of the system update command.But maybe this will make the update work better.

 

 

By Pieter Veenstra

Business Applications and Office Apps & Services Microsoft MVP working as a Microsoft Productivity Principal Consultant at HybrIT Services. You can contact me using contact@veenstra.me.uk.

2 thoughts on “SharePoint 2013 – Exception calling “SystemUpdate” with “0” argument(s)”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.