How can I update multiple items with a shared customer number on a sharepoint list with AJAX?

I am trying to update a sp list with the following javascript/ajax. It succeeds until it gets to the ajax function, which is where it fails. It says the ItemID is not defined, when it is defined as:

var ItemId=item.ID

Any help appreciated.

  

What I'm trying to do:

I am trying to update all records in a list where the cust_number (a column in the list) field is 17 so that assign (another column) = "testinput".

eg:

Cust Number| Assign

17 | testinput

1 |

17 | testinput

Solved

I'm afraid you made a simple typo.

On a certain point in your code you declare the following:

var itemId = item.ID;

Later on you try to acces that same variable

url:_spPageContextInfo.siteAbsoluteUrl + "/_api/web/lists/getbytitle('" + listName + "')/items('" + ItemId + "')",

However itemId != ItemId

Javascript is case sensitive.


Comments

Popular posts from this blog

OpenCV return keypoints coordinates and area from blob detection, Python

.NET File.WriteAllLines leaves empty line at the end of file