Question

So Ive been sitting for half a day already trying to solve that. I have been able to successfully run the following query to find a value of another column on a small test-list:

$(document).ready(function() {
var raz = "raz";
var queryLookup = "<Query><Where><Eq><FieldRef Name='Title'/><Value Type='Text'>raz</Value></Eq></Where></Query>";
var itemfield="";

$().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "Testowa",
    CAMLViewFields: "<ViewFields><FieldRef Name='kolumna'/></ViewFields>",
    CAMLQuery: queryLookup,
    completefunc: function(xData,Status) { 
        itemfield = $(xData.responseText).find("z\\:row").attr("ows_kolumna");;
alert(xData.responseText);
      } 
   });

  alert(itemfield); 

});

but as soon as I try applying it to a bigger list (less than 5k elements though) it just does not want to work and gives me no elements found and the following message in console: SCRIPT5007: Unable to get property 'B' of undefined or null reference shellcoreprimeg2m_6bed6c50.js (22,23129)

Messege I get

Does anyone have any idea as to why this happens?

Was it helpful?

Solution

Okay so I found a solution I think - just playing around with the CAML builder. It appears that if you change <FieldRef Name='Title'/> to <FieldRef Name="Title"></FieldRef> it suddenly starts working.

Answering some comments: It does not matter if I use contains or Eq, it did not work for both, but it works for both now. The list has less than 5000 items.

I hope this helps if someone runs into a similar problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top