ows_Author or ows_Editor not returning data

May 22, 2013 at 4:20 PM
I am trying to get the created by from a SharePoint custom list. i am not sure what i an doing wrong. it return a row and i can get the ows_Title. Can someone help me. I have tried CAMLViewFields: "<ViewFields Properties='True' />", as well but no luck.
Here is the code.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script><!-- Reference SPServices on cdnjs (Cloudflare) --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/0.7.2/jquery.SPServices-0.7.2.min.js" type="text/javascript"></script>
$().SPServices({
        operation: "GetListItems",
        async: false,
        listName: "WikiComments",
        CAMLViewFields: "<ViewFields >" +
                    "<FieldRef Name='Created'></FieldRef>" +
                    "<FieldRef Name='ows_Author'></FieldRef>" +
                    "<FieldRef Name='ows_Editor'></FieldRef>" +
                "</ViewFields>",
CAMLQuery: "<Query><Where><Eq><FieldRef Name='WikiID'/><Value Type='Text'>" + _spPageContextInfo["pageItemId"] + "</Value></Eq></Where></Query>",
            completefunc: function (xData, Status) {
            $(xData.responseXML).SPFilterNode("z:row").each(function() {
alert("Author: "+$(this).attr("ows_Author")+" Editor: "+$(this).attr("ows_Editor"));
liHtml = liHtml + "<li>" + $(this).attr("ows_Title") + "-------------"+ $(this).attr("ows_Author") +"</li>";

$("#targetDIV").html(liHtml);
             });
        }
    });
}); </script><div id="targetDIV" style="border-top: 1px; border-right: 1px; border-bottom: 1px; border-left: 1px"></div>
May 22, 2013 at 4:30 PM
got it,
here is what i had to do
CAMLViewFields: "<ViewFields Properties='True' />",
instead of
CAMLViewFields: "<ViewFields>" +
                    "<FieldRef Name='Title'></FieldRef>" +
                    "<FieldRef Name='Created'></FieldRef>" +
                    "<FieldRef Name='ows_Author'></FieldRef>" +
                    "<FieldRef Name='ows_Editor'></FieldRef>" +
                "</ViewFields>",
Coordinator
May 22, 2013 at 5:08 PM
The names of columnsin the ViewFields shouldn't be preceded by "ows_".

M.