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

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.

 

 


Discover more from SharePains

Subscribe to get the latest posts sent to your email.

Avatar of Pieter Veenstra

Is your business still running on paper trails, sprawling Excel files, or ageing Access databases? There's a better way — and I can show you exactly what it looks like. I'm the Technical Director of Vantage 365, a Microsoft solutions consultancy working with clients across the UK, the Netherlands, and worldwide. For over 30 years I've been turning messy, manual business processes into clean, automated systems that save time, reduce errors, and give teams the visibility they need to make better decisions. You can contact me using contact@sharepains.com

Related Posts

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.

Discover more from SharePains

Subscribe now to keep reading and get access to the full archive.

Continue reading