UpdateList Items not updating choice column

Jan 9, 2014 at 12:12 PM
Edited Jan 9, 2014 at 12:12 PM
Background:
I am trying to update a drop down choice field using Update List items. This is a site column used in a custom content type.

Code that I am using is

function UpdateWishList(ListName,varID,PStatus)
{
$().SPServices({
    operation: "UpdateListItems",
    async: false,
    batchCmd: "Update",
    listName: ListName,
    ID: varID,
    valuepairs: [["ParticipantStatus",  "Notification"]],
    completefunc: function(xData, Status) {

    }
});     
}

Options tried:
Instead of passing the variables, hard coded values were passed

I have tried to take the output of xData.responseText, inside completefunc. Execution shows it is success, alert shows the updated data, however, when I check the list, it still has the old value.

I am using SPServices-2013.01.js along with jquery-1.10.2.js

Please help!!!
Coordinator
Jan 9, 2014 at 3:05 PM
In the code you've posted above, you're trying to set the column with an InternalName of "ParticipantStatus" to the value "Notification". I doubt that's what you intend.

The Status just indicated if the call was successful; it doesn't tell you if the update was successful. For that, you need to look at the returned data.

You probably want to do something like this:
function UpdateWishList(ListName,varID,PStatus)
 {
$().SPServices({
    operation: "UpdateListItems",
    async: false,
    batchCmd: "Update",
    listName: ListName,
    ID: varID,
    valuepairs: [["ParticipantStatus",  PStatus]],
    completefunc: function(xData, Status) {

    }
});     
}
M.