Monthly Archives: July 2014

Enable custom ribbon button only if user has permission to edit selected item

The simplest and way to hiding a SharePoint Custom action in a ribbon(/or anywhere) for users whom doesn’t have item edit permissions is, using “Rights” attribute of “CustomAction” element.  Comma separated set of rights can be specified here so that the cumulative rights set will be formulated by ANDing all different individual rights. All possible Rights available are SPBasePermissions


RegistrationId=”10001″ Sequence=”20″
Rights=”EditListItems,AddListItems” >


“Handle with Care “ – SharePoint Lists with Large lists

Here are few key things to remember when implementing SharePoint applications with high volumes of data.

    1. Never try to override List View Threshold. Keep it to 5000 as it is by default.
    2. Try avoiding increase of “List View Lookup Threshold”, keep it as 8
    3. Apply indexes to relevant columns. Be mindful about the content of column before adding indexes
    4. Use out of the box webparts as much as possible. Utilize parametrized list view webparts, connected webparts etc to achieve advance filtered listings
    5. Make sure to use indexed columns as much as possible in CAML queries
    6. Make sure to prioritized CAML query filters depending up on number of items filter out by each clause
    7. Avoid using People fields for CAML query filtering (anyway those are not index-able)
    8. Don’t rely on lookup columns heavily.
    9. Make sure you filter only the required set of list items
    10. Try using SPListItem.GetItemById whenever an Items being retrieved
    11. Avoid using SPQuery to make queries, instead user ContentIterator so that there will be less locks in DB
    12. If required, use caching(possibly ASP.Net Cache) when custom code is being used
    13. Off load processing from server as much as possible


      Some more tips by Amit Phatak at