Friday, January 13, 2012

Tips and Tricks for Sharepoint 2011

Here are some of my recently used tips and tricks in SP 2010 environment. My plan is to keep this as a working document to keep adding my learnings so that there is one central location for reference! 


  •  If your Custom webpart has a form to input new list items via CAML do not use spList.Update();  This will avoid you the error 0x80070005.
  • Install Visual Studio Service Pack 1 to avoid Initialize control errors while compiling the code which has too many elements in the .ascx files. ( Tip - use shorter Id and class names to compile)
  • A lot of times the requirement is to display Calculated dates, this is easy via calculated columns i.e. 3 months due date
    Calculated date: =DATE(YEAR([Due Date]),MONTH([Due Date])+3,DAY([Due Date]))

  • Display the date in SP designer in a format "mm/dd/yyyy" changes needed in XSLT
    <xsl:value-of select="msxsl:format-date(@Due_x0020_Date, 'MM-dd-yyy')"
  • Just a quick one.
    I was trying to add and deploy a WSP file.Both went well until  I tried adding the webpart and got this error, also when I tried compiling my solution in Visual Studio, the same error resurfaced!
Web Part Error: No available sandboxed code execution server could be found.


well, looks like some service was not working as expected!

Goto SP 2010 Central Admin > App Management > Service Apps > Manage Services on Server. Restart / Start the SharePoint Foundation Sandbox Code Service service instance from services on server. 
  • When you create a new webpart to replace your out of the box new/edit/display form in SP designer - do not delete the Out of box form, close this one. This will avoid you errors in future while display and save of custom designer form.
  • When Making a new Master Page in SP designer, Start with the Starter master pages plenty can be found online, or copy an OOB master page and modify it. Do not remove the aspcontent placeholders, keep them in a hidden div. Deploying master pages via wsp solutions in Visual Studio is a better way but for POC and getting things done quick you can use SP designer. Remember the SPDesigner customizations will have a performance hit since now Sharepoint is not picking it up from the file system ( 14 hive) but from the Database.
  • When creating a URL for your new sharepoint site, avoid spaces to ensure that your link is both shorter and less likely to break when shared via email or instant message.
  • Often you get the long running "Building ther report" message in SP Designer, well not many people know that if you switch the nodes in the left navigation it happens faster.


    No comments:

    Post a Comment