Monday, August 22, 2011

List Attachments over 50MB need more than an increase in Maximum Upload Size... - Brett's SharePoint Blog - Site Home - MSDN Blogs

Basically there's a setting maxRequestLength in web.config file at the IIS level that will block list attachment uploads above 50MB. maxRequestLength="204800" would allow list attachment up to 200 MB.

Friday, August 5, 2011

How to debug InfoPath 2010 browser enabled form with code behind

Here is a step by step instruction by Nik Patel. The instruction works beautifully. It is the best instruction on this topic I have found so far.

Step by Step – Debug InfoPath 2010 Forms Deployed on SharePoint 2010 Using Visual Studio 2010

Wednesday, July 20, 2011

"relative links" Error when verifying/uploading infopath 2010 form template

Got the following error message when trying to deploy an infopath 2010 form template with code via central administration to production:

“Relative links to Data Connection Libraries located in different SharePoint Site Collections are not supported.”

Google search found the following blog 

Relative Links” Error Message when verifying an InfoPath Form Template by Rob Finney

In summary, the url to the SharePoint site needs to be exactly the same, including upper/lower cases, in the data connection settings. So to fix, just delete the offending data connection, add it back, then convert it to data collection file, at this step, ensure the url is correct and the capitalization of each letter is exact the same as the other data connections.

Monday, March 14, 2011

Delete All Items, including Folders, from SharePoint List Programmatically and Efficiently

From this post by Praveen Modi.

/// Purges items and folders from a list
/// Define WSSV3 to remove list folders

/// The SPList you want to
/// purge items from
private static void PurgeList(SPList list)
Console.WriteLine("Purging list: " + list.Title);
Console.WriteLine("Base Type: " + list.BaseType.ToString());

// ===========================================================
// list.ItemCount returns a count that includes all items
// "AND" folders.
// You can't use list.Items.DeleteItemById() to remove a
// folder
// ===========================================================
System.Collections.Hashtable hItems =
new System.Collections.Hashtable(list.ItemCount);

// ===========================================================
// SPList.Items returns all list items in the entire list
// regardless of folder containment
// Note, just because list.ItemCount includes folders,
// list.Items does not.
// ===========================================================
foreach (SPListItem item in list.Items)

// Remove the list items
foreach (int ID in hItems.Keys)
// Clear the hashtable
// ===========================================================
// SPList.Folders returns all folder items in the entire list
// regardless of parent folder containment
// ===========================================================
foreach (SPListItem item in list.Folders)

// Remove the folder items
foreach (int ID in hItems.Keys)

Friday, March 11, 2011

Expiration Policy Timer job does not seem to run

Copied from this post:


The policy is run once a day, however fortunately you can start it manually. Using Central Admin->Operations->Information Management Policy Configuration, I clicked on the Expiration policy link. Then within there clicked "Process Expired Items Now". Looked at the Timer Job Status (Central Admin->Operations->Timer Job Status) and there was no reference of the Expiration Policy.

Looked within Timer Job Definitions (just under the Timer Job Status link) and a timer job had been created called "Expiration Policy (manually initiated)" but it had never been run. Actually neither had the daily "Expiration Policy". I went back to the Information Management Policy Configuration and into the Expiration policy. The "Process Expired Items Now" button was greyed out, to clear this I ended up deleting the "Expiration Policy (manual initiated)" timer job. This enabled the "Process Expired Items Now" button... however nothing.

Other things that I tried included stsadm -o execadmsvcjobs - though nanda.

Then I thought about the fact that the job had never been run and I found this article

Following the instructions sorted the problem...


Monday, January 3, 2011

CAML Query returns all items

I use CAML Query Builder a lot, a great tool. However, I ran into a situation that the CAML query returns all the items of a list. Thanks to Google, I found a blog entry by Steve Pietrek. His suggestions fix the problem.

Specifically, I did the following:

  1. remove the opening and closing query tag
  2. change the double quote to single quote in the query.