cd ../blog

Why Changing Fields That Are ReadOnly Mustn't Be Changed + lists.asmx

Cryptic lists.asmx errors (0x80070057 and ObjectDisposedException) caused by a PowerShell script that made built-in fields like ID read-only — and the fix.

</>

Problem: lists.asmx threw errors when updating a field:

0x80070057 Bad parameter passed to Web Server Extensions. Check the information you entered and try again.

or:

SOAP exception: System.ObjectDisposedException: Cannot access a closed Stream.

That’s not good. We started looking into almost everything SharePoint has to offer. Changing the SOAP call to getItem worked fine — so the issue was specifically with updating.

The Cause

After a long search, Bram found the answer. Some time ago a PowerShell script had been run to set the ReadOnly property of various fields to true. Normal enough — but the script had also changed built-in fields that are supposed to be read-only, like ID.

The Fix

Bram changed the ReadOnly property of those built-in fields back to false, and everything was good again in SharePoint country! 😄

Big thanks and respect to Bram for tracking this one down.

Full details on Bram’s blog post.