views:

362

answers:

1

In SharePoint I am using the default view of a list. When I use GetListItems method I can pass into it the following:

public XmlNode GetListItems (
    string listName,
    string viewName,
    XmlNode query,
    XmlNode viewFields,
    string rowLimit,
    XmlNode queryOptions,
    string webID
)

I am passing in "" for the viewName and am passing a rowLimit of 1000. By Default view only returns 100 items. 100 Items are still being returned not 1000.

Can you use the rowLimit when not specifying a view? Is it possible to bring back 1000 items using the query instead? I do not really want to use a GUID for the viewName as I would have to look it up for each list and perform a big refactor.

Update

I am now using the guid of the view and my list still returns the incorrect number of items. I know the guid is being used as I sued an incorrect one and it errord out.

Any ideas what could be wrong?

The code that is being sent to the service is as follows:

<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'&gt;
    <listName>Media Outlet</listName>
    <viewName>{2822F0D9-A905-44B5-8913-34E6497F1AAF}</viewName>                         
    <query><Query><Where><Eq><FieldRef Name='Outlet_x0020_Type' /><Value Type='Lookup'></Value></Eq></Where><OrderBy><FieldRef Name='Title' /></OrderBy></Query></query>
    <ViewFields></ViewFields>
    <RowLimit>1000</RowLimit>
    <QueryOptions></QueryOptions> 
    <webID></webID>
</GetListItems>     

Update I have tried with a RowLimit as 1 and I still get a lot of the results back???

+2  A: 

The xml should be as follows:

<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'&gt;
    <listName>Media Outlet</listName>
    <viewName>{2822F0D9-A905-44B5-8913-34E6497F1AAF}</viewName>                         
    <query><Query><Where><Eq><FieldRef Name='Outlet_x0020_Type' /><Value Type='Lookup'></Value></Eq></Where><OrderBy><FieldRef Name='Title' /></OrderBy></Query></query>
    <viewFields></viewFields>
    <rowLimit>1000</rowLimit>
    <queryOptions></queryOptions> 
    <webID></webID>
</GetListItems> 

You need lower-case names so rowLimit rather than RowLimit.

Linda