-1

I need to get a number of fields from my list. I've got the ID but dont know how to get the Title, Created by, Customer Name. etc. Once I get these values I want to populate the form.

Code so far that gets ID

    var lastId = $().SPServices.SPGetLastItemId({ 
    listName: "myList"
  }); 
1
  • sorry what ? can you explain your question properly please Jun 18, 2012 at 15:18

1 Answer 1

4

I think you are talking about the Jquery SPServices library, you should start by reading the spservices documentation here:

http://spservices.codeplex.com/documentation

I'll give you a code sample, but to get this really working you need to read the documentation.

function GetEvents() {
    $().SPServices({
        debug: true,
        operation: "GetListItems",
        async: false,
        webURL: '/',
        listName: "Events",
        completefunc: function (xData, Status) {
            $(xData.responseXML).find("[nodeName='z:row']").each(function () {
                events.push({
                    Id: $(this).attr("ows_ID"),
                    Nombre: $(this).attr("ows_Title"),
                    Descripcion: $(this).attr("ows_Description"),
                    TipoEvento: $(this).attr("ows_EventType"),
                });
            });
        }
    });
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.