InfoPath data connection not returning all results from a SharePoint list - SharePoint Development & Administration + InfoPath

Monday, April 27, 2009

InfoPath data connection not returning all results from a SharePoint list

Problem

I have a data connection retrieving ID values from a library’s items to determine the maximum ID of items currently in the list. Certain metadata results in items not appearing in the default view. When InfoPath queries the data connection, only IDs of items which display in the default view are retrieved.

This became a problem as the maximum ID found by InfoPath was 240, when documents existed in the library with an ID of 246. To complicate the matter even further, a number of documents had been added and removed from the library making the next available ID 268. I needed InfoPath data connection to give me the maximum ID of current documents (246).

Cause

Data connections in InfoPath return the same results as the default view for the specified SharePoint list.

Solution 1:

  • Create a view which returns all items in a list / library (no filter criteria) – Set this view as default
  • Will work well for lists libraries with less than 2000 items, and when a custom view is not required as the default

Solution 2:

If a large number of items exist in a library, performance can be maintained by creating a view which filters out items which are not required. If a list contains over 2000 items, create a view which returns the most recent 200 items which satisfy reasons for using the InfoPath data connection. In terms of the example above, as I need to find the maximum ID of current documents, the result won’t be affected if documents older than two months (IDs 1 to about 150) filtered out.

This would also apply when you require a view with custom filtering as the default view for a list. If this is the case, care must be taken when setting filter criteria to ensure that items to be retrieved by the InfoPath data connection are returned by the view.

If you required a custom view as the default, but are not getting the expected results: Try both:

  • Keep the custom view
  • Create a view to return all items in a list, set as default (this is for the InfoPath data connection)
  • Modify all hyperlinks pointing to the list (site navigation, web part titles, etc.) to point to the custom view if a user navigates to the list. (this is for the SharePoint User Interface)

Note: You may have to set the item limit to number greater than the total number of items in the list / library

  • There is no set maximum number of documents or items allowed in a SharePoint list or library, but performance is affected when a large number of items exist.

SharePoint (MOSS 2007) Document library and List item limits

The following is a summary of Microsoft’s recommended item limits required to maintain server performance. (Reference: http://technet.microsoft.com/en-us/library/cc262787.aspx )

  • Document Library: Max 5 million, recommended 2000 to maintain list view performance (time to load a page containing the list items)
  • Max file size: 50MB (default) – can be set up to 2GB.

Share this article:
Stumble This Delicious
Delicious
submit to reddit
Facebook
MySpace
MySpace

No comments:

Post a Comment