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

New Post: SPUpdateMultipleListItems Item limit

$
0
0
I have had to update large amounts of data in a 'batch' way and did so by writing my own function that uses the UpdateListItem operation. I'm my case, I found that doing 100 at a time was a good number (kept the message size across the wire reasonable).
Here is the design I used:

- create a function that accepts an array of all the updates you want done (number of updates don't matter). Set that function to return a jQuery promise which will be resolved once all updates are done. This allows for your program to "attach" logic that you may want to execute later when all updates are done.
- in the function, set up your code to loop through the array an build your update contract up until your set limit (ex 100 items). Once that limit is hit, make the update (with async: true) and when that update is done, get back to the loop and continue on to do the same thing until the entire array is done.
- once all updates are done, resolve the Deferred, so that any functionally you may have waiting on this update can be executed.

Hope this helps.

(If I remember tomorrow, I'll see if I can find the function I wrote. I think I built it to be generic and specific to the application I used it on, so you may be able to reuse it. )

_____
Paul

Sent from mobile device.

Viewing all articles
Browse latest Browse all 6517

Trending Articles



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