13.07.2015 Views

Microsoft SharePoint. Building Office 2007 Solutions in VB 2005 ...

Microsoft SharePoint. Building Office 2007 Solutions in VB 2005 ...

Microsoft SharePoint. Building Office 2007 Solutions in VB 2005 ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 11 ■ PROGRAMMING SHAREPOINT SERVICES 437List<strong>in</strong>g 11-12. Returned GetListItems CAML FragmentThe GetListItems method takes several arguments and requires some additional effort tocall because several of the parameters are actually CAML fragments themselves. These parametersmust be constructed <strong>in</strong> code before the method call is made. Specifically, the GetListItemsmethod requires the follow<strong>in</strong>g parameters: listName, viewName, query, viewFields, rowLimit,and queryOptions.The listName parameter is either the list name (e. g., Shared Documents) or the GUID ofthe target list from which items are to be returned. This is the same parameter that is usedthroughout the various methods of the Lists web service. This parameter is required.The viewName parameter is the GUID of the view to be used when determ<strong>in</strong><strong>in</strong>g what fieldsto return. This parameter is optional and can be replaced with the keyword Noth<strong>in</strong>g <strong>in</strong> <strong>VB</strong>.When no view is specified, the method will return the fields conta<strong>in</strong>ed <strong>in</strong> the default list viewunless you override this behavior by specify<strong>in</strong>g different fields. Generally, it is easier not tosupply this parameter and specify the desired fields later.The query parameter is a properly formatted CAML Query element that specifies whatitems to return from the list. This parameter is optional and can be replaced with the keywordNoth<strong>in</strong>g <strong>in</strong> <strong>VB</strong>. When provided, the def<strong>in</strong>ed query overrides the query normally associated withthe default view.The viewFields parameter is a properly formatted CAML ViewFields element that specifieswhat fields are to be returned with each item. This parameter is optional and can be replacedwith the keyword or Noth<strong>in</strong>g <strong>in</strong> <strong>VB</strong>. When provided, the def<strong>in</strong>ed field set overrides the field setnormally associated with the default view.The rowLimit parameter is a str<strong>in</strong>g represent<strong>in</strong>g the number of items to return from themethod call. This parameter is optional and can be replaced with the keyword Noth<strong>in</strong>g <strong>in</strong> <strong>VB</strong>.When provided, the rowLimit overrides the limits associated with the default view. The rowLimitparameter can also be used to set up a pag<strong>in</strong>g when used <strong>in</strong> conjunction with the queryOptionsparameter.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!