woensdag 9 maart 2011

SharePoint 2010 URL tokens

Just a quick post to inform you about some new URL parameters you can use within SharePoint 2010. The following list also contains some URL parameters that were also available in SharePoint 2007.

{ItemId} – ID (GUID) taken from the list view.
{ItemUrl} – Web-relative URL of the list item (Url).
{RecurrenceId} – ID of a recurrent item (RecurrenceID).
{SiteUrl} – The fully qualified URL to the site (Url).
{ListId} – ID (GUID) of the list (ID).
{ListUrlDir} – Server-relative URL of the site plus the list's folder.
{Source} – Fully qualified request URL.
{SelectedListId} – ID (GUID) of the list that is currently selected from a list view.
{SelectedItemId} – ID of the item that is currently selected from the list view.



dinsdag 8 maart 2011

Playing with the SharePoint 2010 ribbon

Via the SPRibbon object (! this object needs both the Microsoft.SharePoint and the Microsoft.Web.CommandUI DLL's) you can do all kinds of stuff with the SharePoint 2010 ribbon user interface.

Basically you can do something like this in the code of for example a web part:

SPRibbon ribbon = SPRibbon.GetCurrent(this.Page);

and then call any method you want. For the ID's of the out of the box ribbons, check this file:

14/TEMPLATE/GLOBAL/XML/CMDUI.xml

SPRibbon methods not available

Some time ago I was experimenting with the SharePoint 2010 ribbon. Basically I wanted to hide some out of the box ribbon buttons. Via the SPRibbon class in the Microsoft.SharePoint.WebControls namespace you can get references to the ribbon and do all kinds of stuff.

Now the problem was that I did not have access to all the methods I would expect to see. After some searching I found out that you not only need a reference to Microsoft.SharePoint.dll but also to Microsoft.Web.CommandUI dll. Once done, you will see all the methods.

maandag 7 maart 2011

Custom errors and callstack are not shown for my SharePoint 2010 installation

We all know that by default SharePoint will not show you the complete details of an error when it occurs. In SharePoint 2007 you could easily configure this by changing some values in the web.config of the appropriate web application. Basically you would change the callstack, customerrors mode and debug values.

Now in SharePoint 2010 you would expect the same behaviour but changing just the web application's web.config will not show you the complete error details. For this you must change the values in these web.config locations:
  1. The web application
  2. 14/Config
  3. 14/Template/Layouts

You will want to change these properties:

customErrors mode="Off"
callstack="true" ... AllowPageLeveTrace="true"
compilation batch="false" debug="true"

woensdag 19 januari 2011

Group by 'Content type' in SharePoint 2010

For some reason it seems that you cannot group by the 'Content type' field in SharePoint 2010 lists. This can be solved though by using SharePoint designer. It's not an ideal solution but at least it works.

Open the ASPX page of the view where you want to group by 'Content type'. In there, locate the 'View' XML tag and extend the 'Query' XML to something like this:


donderdag 16 december 2010

Cannot start service SPUserCodeV4 on computer

I encountered this error when I was trying to deploy a solutions right from within SharePoint 2010. It seems this is because a necessary service is not running. The particular service we are talking about here is called "Microsoft SharePoint Foundation Sandboxed Code Service".

To turn it back on:
* Go to Central Administration -> System settings -> Manage services on server
* Locate the service and turn it back on

This should allow you to again deploy solutions from within Visual Studio 2010.

zaterdag 11 december 2010

Could not load type 'System.Data.Services.Providers.IDataServiceUpdateProvider'

Recently I was experimenting with an add-in for Outlook 2010 from where I want to do all kinds of things in SharePoint 2010. Therefore I wanted to make use of the /_vti_bin/listdata.svc Service Reference. When I tried to add the service reference in Visual Studio 2010, I received the error.

After searching for some time and checking assemblies and their versions, I came to the conclusion you have to install the latest version of the ADO.Net services. I found the latest version for Windows 7 and Windows Server 2008 R2 here: http://www.microsoft.com/downloads/en/details.aspx?familyid=79d7f6f8-d6e9-4b8c-8640-17f89452148e&displaylang=en