SharePoint Lists.asmx UpdateListItems SET Field1 = NewValue WHERE Field1 = OldValue (filter for updating)

What I would like to do seems simple, I have an application that interacts with some SharePoint lists (MOSS 2007) through SharePoint Services. In one service call, I would like to update one or more list items. The problem is that I only want to update those elements where the field for updating is equal to the old value. My thought was to use List.UpdateListItems and then filter, but I could not find the syntax for it.

In pseudo: update [Name] to "NewName" of all items in [ListA], where [Name] = "OldName"

One solution I would like to avoid: Get the identifier of all ListItems, where Name = "OldName", and skip them, creating a separate service call for each of them to update Name = "NewName".

I cannot reference Microsoft.SharePoint assemblies, so ideally this is a single service call.

+3
source share
1 answer

You will need to make 2 calls , one to receive the corresponding items and one to perform updates.

This can be quite attractive, so I wrote a blog post here (including the necessary code): http://www.wirebear.com/blog/2011/02/11/batch-updates-with-sharepoint-2007-services/

+1
source

Source: https://habr.com/ru/post/1791577/


All Articles