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

New Post: CAMLQuery filter not working

$
0
0
I would appreciate some help. I have a really successful map going. It uses spservices GetListItems wonderfully to return everything and put it on the map. But I sure would like to filter for Status=Closed items. Here is the code. If I comment the CAMLQuery:... line it runs perfectly.
    function getlocations() {
        //RETRIEVE DATA FROM SHAREPOINT LIST
        $().SPServices({ 
            operation: "GetListItems", 
            async: false, 
            listName: "Event List Free",
            CAMLQuery: "<Query><Where><Eq><FieldRef Name="Status" /><Value Type="Choice">Closed</Value></Eq></Where></Query>",
            completefunc: function (xData, Status) { 
            alert(xData.responseXML.xml);
                $(xData.responseXML).SPFilterNode("z:row").each(function() {
                //BUILDING MY VARIABLES FROM MY LIST COLUMNS
                var myTitle = $(this).attr('ows_Alert_x0020_Type');
                var myLong = $(this).attr('ows_Longitude');
                var myLat = $(this).attr('ows_Latitude');
                var myStatus = $(this).attr('ows_Status');
                var myRegion = $(this).attr('ows_Event_x0020_Type');
                var myManned = $(this).attr('ows_Lead_x0020_Region');
                var myLink = $(this).attr('ows_Link');
                var myInfo = "<table>" +
            "<tr><td><b>Type  </b></td><td>" + myTitle + "</td></tr>" +
            "<tr><td><b>Latitude</b></td><td>" + myLat + "</td></tr>" +
            "<tr><td><b>Longitude</b></td><td>" + myLong + "</td></tr>" +
            "<tr><td><b>Event  </b></td><td>" + myRegion + "</td></tr>" +
            "<tr><td><b>Lead  </b></td><td>" + myManned + "</td></tr></table>" +
            "<tr><td><b>Status  </b></td><td>" + myStatus + "</td></tr></table>"
            "<tr><td><b>Link</b></td><td>" + myLink + "</td></tr></table>"          
            //var myPicture = $(this).attr('ows_Picture');
            //PUSH ALL VARIABLES INTO ARRAY
        funclocations.push([myTitle, myLong, myLat, myRegion, myManned, myStatus, myLink, myInfo]);
                }); 
            } 
       });
        return funclocations;
    }

Viewing all articles
Browse latest Browse all 6517

Trending Articles



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