Ask a questionAsk a question
 

Answersharepoint web services

  • Tuesday, November 03, 2009 5:00 PMSathishreddy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello,

    I have a custom list called Reports with columns projectsid,startdate,enddate,status,mgrname and priority. Then I created custom standard view called Myprojectview and made MyProjectView as an default view.I am using GetListItems  method to fetch data from Reports list.

     

    XmlNode ndListItems = spListsWS.GetListItems("Reports", String.Empty, ndQuery, ndViewFields, "5000", ndQueryOptions, string.Empty);

    In this process I am missing few columns and data.How to fetch all columns with data from ALL Items view.

    Thanks in Advance

Answers

  • Wednesday, November 04, 2009 5:27 AMAshwin A. Bhagwat Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Make sure all the column is added in Myprojectview view which you are expecting to be return by function. & Pass the your View Name when you call the function GetListItems().
    Ashwin B. | My Blog | Twitter
  • Tuesday, November 03, 2009 6:11 PMAvinashKT Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     AnswerHas Code
    Hi Sathish,

    To get all records use All Items SPView.

    Syntax -
    Refer - http://msdn.microsoft.com/en-us/library/lists.lists.getlistitems.aspx
    public XmlNode GetListItems (
        string listName,
        string viewName,
        XmlNode query,
        XmlNode viewFields,
        string rowLimit,
        XmlNode queryOptions,
        string webID
    )

    Regards, Avinash | avinashkt.blogspot.com
  • Wednesday, November 04, 2009 3:01 AMSteve.CurranMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Make sure to pass in the "All Items" view name and make sure the view fields node is null.

    XmlNode ndListItems = spListsWS.GetListItems("Reports", "All Items", ndQuery, null, "5000", ndQueryOptions, string.Empty);

    certdev.com

All Replies