Baga Jr.
Baga Jr.

Reputation: 153

Using SPServices to update SharePoint List

I want to change a property of a SharePoint list item with given input. I used the documentation and got this, but I'm not sure what I'm doing wrong. There could be something completely wrong because I'm not too experienced.

$().SPServices(
        {
            operation: "UpdateListItems",
            async: false,
            listName: "TechInv",
            Number: itemNumber,
            valuepairs: [[property, replacement]],
            completefunc: function(xData, Status) {
                // ...
            }
     });

Upvotes: 0

Views: 3861

Answers (3)

Jinxed
Jinxed

Reputation: 736

$().SPServices(
    {
        operation: "UpdateListItems",
        async: false,
        listName: "TechInv",
        ID: itemNumber,
        valuepairs: [[property, replacement]],
        completefunc: function(xData, Status) {
            // ...
        }
 });

ID is the change and it should work.

Upvotes: 0

AymKdn
AymKdn

Reputation: 3927

You can use Firebug (addon of Firefox) or the web toolbar of your browser to look at the query that is sent to the server, as well as the error message returns by the server. That way you can more easily find where the issue is. In your case you used "Number" instead of "ID" I think.

BTW, I created a Sharepoint API in JavaScript that is, I think, easier to use than SPServices. It's there : SharepointPlus

Upvotes: 0

Christophe
Christophe

Reputation: 28154

The SPServices plugin is well documented. In your case, it seems that you are missing the item ID.

Upvotes: 1

Related Questions