Update SharePoint list item based on id value

Here’s how to update a list item based on a id using SP Services. This is a snippet of code from one of my projects. It updates a list based on ‘itemID’.

function UpdateCurrentResultList(itemValue,itemID,k)

    {
        $().SPServices({
            operation: "UpdateListItems",
            async: false,
            listName: "Current Results List",
            ID: itemID,
            valuepairs: [["CurrentResultQtr"+k,itemValue]],
            completefunc: function(xData, status){
                //alert("Sending the xml request to the server was: " + status);
                //alert("Sharepoint processing of the message returned: " + xData.responseText);
        }
        });
    }
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s