Reply To: Query/Update/Delete an item in JavaScript

Home Forums Classic DFFS Query/Update/Delete an item in JavaScript Reply To: Query/Update/Delete an item in JavaScript

#37939

var query = “<Where><Eq><FieldRef Name=’Name’ ></FieldRef><Value Type=’User’> PreferredName</Value></Eq></Where>”;
var camlViewFields = [“Reports_x0020_To”, “Department”, “Position”, “Job_x0020_Title”, “Hire_x0020_Date”,
“Perm_x0020_Date”, “Status”, “ADP_x0020_File_x0020__x0023_”, “Location”, “Company”,
“ADP_x0020_File_x0020__x0023_”, “Sprout_x0020_Employee_x0020_ID”];

var res = spjs.utility.queryItems({
“listName”: “TestList”, // List display name or GUID
“listBaseUrl”:”http://team/XYZ/&#8221;,
“query”: query,
“viewFields”: camlViewFields,
“primaryKey”:”1″
});
if(res.count>0) {
console.log(res.items) ;
}
else {
console.log (“No Items”);
}
In the above snippet, I am trying to query the TestList which resides at SharePoint 2016 On-Prem.Then the count is always 0, nut when I try to query any list which is there on Same SharePoint Online, it works… Is this a limitation ?

Attachments: