Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: Operation GetListItems is not working when I insert the CAML query to filter the options.

$
0
0

Hello M,

I did change the query as you suggest, but no records are retreived. I even created a new list to test it out, I have two columns, the Title (contains department names) and the Manager, where manager is a people picker field set up to display the ID. Here is the modified code:

$(document).ready(function() {
$().SPServices({  
     operation: "GetListItems",  
     async: false,  
     listName: "Departments",
     CAMLQuery: "<Where><Eq><FieldRef Name='Manager'/><Value Type='Integer'>" + $().SPServices.SPGetCurrentUser({fieldName: "ID"}) + "</Value></Eq></Where>",  
     CAMLQueryOptions: "<QueryOptions><ViewAttributes Scope='RecursiveAll' IncludeRootFolder='True' /></QueryOptions>",  
     CAMLViewFields: "<ViewFields><FieldRef Name='Title' /><FieldRef Name='Manager'/></ViewFields>",  
     completefunc: function (xData, Status) {
      $(xData.responseXML).SPFilterNode("z:row").each(function() {var liHtml = "
  • "
  • + $(this).attr("ows_Title") + ""; $("#tasksUL").append(liHtml); }); } }); });</script>
      "tasksUL"/>
    I am using jquery-1.8.2.min and SPServices-0.7.2.min

    Viewing all articles
    Browse latest Browse all 6517

    Trending Articles



    <script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>