Encouraging two-way communications

Share + Learn + Comment   Encouraging two-way communications

Discover our team’s valuable knowledge, experience, opinions, and advice. And let us know what you think!

Blog

Working With Advanced List Options in SharePoint 2010

In my last article you read how to set item-level permissions on list items for both read and write access. In this article I wanted to dive into a few more functions that you see on the advanced settings page of the list: disabling list item attachments, specify whether the “New Folder” command is available, and specify whether this list should be visible in search results.

The last option that allows you to exclude the list from search results is particularly great. This option will not overwrite permissions to the list (i.e., users that have no access to the list won’t see it anyway). It’s still nice to be able to exclude the list from crawl even if users have read-only access to improve the cleniness of the search results.

As last time, I will present the list using the explicit specification, so that you can run it in a console application project:

SPSite site = new SPSite(”http://localhost”);
SPList userList = site.OpenWeb().Lists["MyList"];

// Specify whether this list should be visible in search results
userList.NoCrawl = true;

// disabling list item attachments
userList.EnableAttachments = false;

// Specify whether the “New Folder” command is available
userList.EnableFolderCreation = false;
site.Dispose();

In reality, you will probably end up running this in a feature receiver or in some sort of a portal configuration script or application.

Enjoy!

  • Facebook
  • Twitter
  • DZone It!
  • Digg It!
  • StumbleUpon
  • Technorati
  • Del.icio.us
  • NewsVine
  • Reddit
  • Blinklist
  • Add diigo bookmark
Post a comment
  1. Formatting options
       
     
     
     
     
       

Please Upgrade Your Browser

This site's design is only visible in a graphical browser that supports web standards, but its content is accessible to any browser or Internet device.