Still getting the hang of using camel and running into issues. I can successfully execute two separate queries, but when I try to combine them, I encounter an error message. Even after reviewing the documentation, I am still unsure about what exactly is causing the problem.
Query1:
var specifier1 = "<Where><Eq><FieldRef Name='Requestor_x0020_Name' LookupId='True'/><Value Type='Lookup'>" +
"<UserID/></Value></Eq></Where>";
Query2:
var specifier2 = "<Where><Eq><FieldRef Name='ID'/><Value Type='Text'>"+currentItemID+"</Value>"+
"</Eq></Where>";
Combined query:
var specifier = "<Where><And><Eq><FieldRef Name='Requestor_x0020_Name' LookupId='True'/><Value Type='Lookup'>" +
"<UserID/></Value></Eq><And><Eq>"+
"<FieldRef Name='ID'/><Value Type='Text'>"+currentItemID+"</Value>"+
"</Eq></And></And></Where>";
The error message that pops up with the combined query states:
Request Failed.One or more field types are not installed properly. Go to the list settings page to delete these fields.
undefined
Once I set the string, I make the following calls. Could it be that a different approach is needed with AND conditions? It seems like things go awry in my enumerator loop's console.log. The error message consistently shows strings of 6's: xxxxxx
camlQuery.set_viewXml("<View><Query>"+specifier+"</Query></View>");
var collListItems = list.getItems(camlQuery);
ctx.load(collListItems);
ctx.executeQueryAsync(
function(){
var enumerator = collListItems.getEnumerator();
count = collListItems.get_count();
while(enumerator.moveNext()){
var item = enumerator.get_current();
console.log("xxxxxID : " + item.get_id());
}
if (count == 0) {
LockDownCells();
}
},
function(sender,args){
console.log("xxxxxxRequest Failed."+args.get_message() + "\n" + args.get_stackTrace());
}
);