Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

Commented Feature: Add support to allow SPUpdateMultipleListItems to use folders [10132]

$
0
0
I needed SPUpdateMultipleListItems to support updating only files in a specific folder, after a bit a digging (and lots of why doesn't SP like my query), I found that with a simple change, SPUpdateMultipleListItems is capable of supporting a single folder with ease.

Basicly, it's 2 lines.
1) add folder = "" to default settings (to ensure it's specifyed)
2) change line 3307 (on version 7.2a):
```
CAMLQueryOptions: "<QueryOptions><ViewAttributes Scope='Recursive' /></QueryOptions>",
```
to
```
CAMLQueryOptions: "<QueryOptions><ViewAttributes Scope='Recursive' />" +
((opt.folder !== "") ? "<Folder>" + opt.folder + "</Folder>" : "") +
"</QueryOptions>",
```

Since the IDs are unique throughout the list including folders, no other changes are required.

Now, the user can specify as an option 'folder: list/folder'. This will make SPUpdateMultipleListItems work only on that folder.

Tested on SP2010

Attached is my changed version to support this feature.


Comments: Very nice, gmyx. Thanks a bunch for providing the fix. I'll get this into the upcoming release - 2013.01. M.

Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>