I've attempted to complete an update to a number column in a SharePoint 2010 list using JavaScript. I can update the title, or any other textbox field but not the number field. I have already attempted what was shown here... Updating number column in SharePoint programmatically
However, I have not been able to get any of the suggestions to work. I did arrive at the same assumption, that my type was wrong but every variation of changing type I have tried still does not work. Here is my code below.
function updateList(updatedArray){
var siteUrl = '/my/site/';
this.clientContext = new SP.ClientContext(siteUrl);
this.oList = clientContext.get_web().get_lists().getByTitle('Testlist');
console.dir(updatedArray);
oListItem = oList.getItemById(7);
oListItem.set_item('Order', 20);
oListItem.update();
/*$(updatedArray).each(function(){
oListItem = oList.getItemById(this[1]);
oListItem.set_item('Order', this[2]);
oListItem.update();
console.dir(oListItem);
}); */
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
}
Order is the name of my number column. I did check it in JSON and that is the name shown. UpdatedArray is an array of list ids and new values for the Order column. The console print confirms the spots in the updatedArray I'm using are correct. As you can see I have even attempted to manually set the value.
I have tried using 20, 20.0, parseFloat("20"), parseFloat(20). The function returns with a querysucceed but no change on number columns. Number column is not set to unique. that's all the info I can think to pass on. Thanks in advance.