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

New Post: SPUpdateMultipleListItems Item limit

$
0
0
@williamevarez,
I think that you're trying to do something like: UPDATE all items WHERE stringFromStatus=Active
This function is not going to help you with that... With Client side programing (using the SOAP interface) there is no direct way to do that. You should also review the UpdatelistItems operation documentation and the MS documentation to get a better understanding of how the service works.

There is a Solution
With client side apps, you need to specifically know all of your updates upfront. So in your case, using the snippet above, you will need to do a GetListItems for everthing in the list with a stringFromStatus=Active and a CurrentDate != currentdate ... then you need to build a list (Array) of updates for each one that GetListItems returns.. Each update "contract" looks like this:
<Method ID='1' Cmd='Update'>
    <Field Name='CurrentDate'>currentdate</Field>
    <Field Name='ID'>1234</Field>
</Method>
Note the <Field Name="ID"> element - each update must have one of these. It tells SP which element needs to receive the update.

Depending on how many records need to be updated, you should not send them all at once to the server... The Function that I posted above basically throttles the updates in batches of 100 (configurable with input param) and when all updates are done, resolves the Deferred, which essentially calls your next action (callback).

Again, the key is that you need to create your list of updates yourself... The SP service is not going to do that for you by using a "WHERE" type of clause.

BTW: You did not post any errors or issues, so I assume you did not see any? Did you see the alerts? if so, which one?
My assumption is that you saw the "all updates done!" although when you checked the list, nothing was updated... My function does not fail when SP returns an error message (which I think it might have in this case)... If you look at the raw response (using browser debuging tools) you will probably see that..

Paul.

Viewing all articles
Browse latest Browse all 6517

Trending Articles



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