I'm using SharePoint 2010, SPServices and the GetListItems method to retrieve items from a list. The list has 31 categories such as A2, A3, A4... until A32. There are also sub categories such as, A2.1, A2.2, A2.3, etc.
The list data outputs into 31 boxes coded in HTML and JavaScript assigns a color to each box according to the highest severity level (high risk=red, moderate risk=orange...)
There will always be 31 colored boxes (A2 thru A32) and I don't need to add new boxes. The JavaScript works where it cycles through all subcategories and correctly outputs the color to the parent. If I EDIT a list item the color changes correctly and if I DELETE a list item, the page updates.
The problem is when I ADD a new list item (A2.1.1) SharePoint isn't seeing the latest list item that was just added until I add a another list item then it will update the previous HTML box color. My question is if the SPServices GetListItem method doesn't actually retrieve the current data set. I've inserted a CAMLRowLimit: 0, and that didn't work.
Has anyone heard of GetListItems not always returning the current data set? When I refresh the browser for a split second all of the boxes change to the previous browser version history and then the page loads.
var method = "GetListItems";
var webURL = $().SPServices.SPGetCurrentSite() ;
var list = "Dashboard";
var fieldsToRead = "<ViewFields>"+"<FieldRef Name='Name' />" +"</ViewFields>";
var query = "<Query><OrderBy><FieldRef Name='ID' Ascending='True' /></OrderBy></Query>";
$().SPServices
({
operation: method,
async: false,
webURL: webURL,
listName: list,
CAMLViewFields: "<ViewFields Properties='True' />",
CAMLQuery: query,
completefunc: function (xData, Status)
{