3

I get the following error when trying to update the choices for a Site Column: "The object has been updated by another user since it was last fetched."

I get this error if I try to add a new choice through the Web UI or through the following PowerShell code:

$web = Get-SPWeb http://dev.domain.local/
$courses = $web.Fields["Courses"]
$courses.Choices.Add("2015 Extravaganza")
$courses.Update()

Exception calling "Update" with "0" argument(s): "The object has been updated
by another user since it was last fetched."
At line:1 char:1
+ $courses.Update()
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : SPException

This content type was created through the Web UI and was not deployed as part of a feature. I also tried updating it by directly modifying the SchemaXml property but I get the same error. Anything I can do to resolve this? It is unfortunately in use so deleting and recreating isn't really an option.

Update: because this Site Column was associated with a Content Type, I went to one of the lists where it was being used, chose to edit the Content Type and Field from there and the update took. I would have much preferred to have it cascade the change through all uses of the column - as well as have the correct choices available for future use of the column.

1

1 Answer 1

1

I've just been doing exactly the same, and had the same issue and it was

The object has been updated by another user since it was last fetched

I've posted a script to fix the field so it can be updated there, rou that first to fix the field (remove the Version attribute in the SchemaXml), then run the actual script you want to run.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.