Tuesday, August 7, 2012

How To Create Custom Error Page with Log Support Ticket Link for SharePoint 2010

We’ve all seen it; the SharePoint 2010 error message with its bold red X yelling at us that we have done something terribly wrong (like it’s our fault!). Every time I see it I think of the Tommy Boy line “What’d you do!!?”


Now, I like the Correlation ID and being able to track the error down. However, in real world scenarios it’s unlikely that our users will leave this screen up and copy/paste to our support group. Wouldn’t it be nice to have a warmer error message with our company logo and a link that will ask the user to send the error details? If not, then you have come to the wrong article!
Error message we start with


Error message we end with



The user can click the “Log SharePoint Support Ticket” link and their email client will load with the prefilled body message asking them to copy and paste the Error Gibberish.




Let’s see how we make the magic happen.

Locate and copy the error.aspx file in Layouts folder of the 14 Hive (%PROGRAM FILES%\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS). Never never never ever touch the system files…make copies and use those.
Create a new folder in the Layouts folder (ex. CustomError) and then paste the copied error.aspx file. Now, I’m not going to go through each line item and explain how I got the company logo or added the link. I’ve included my custom error in a zip file at the end of this blog post for you to dissect. We are going to assume that you have one edited to your liking and are ready to replace the default error message.

Open up your best friend, SharePoint 2010 Management Shell, and perform the following command:

Set-SPCustomLayoutsPage -Identity Error -RelativePath “/_layouts/CustomError/error.aspx” -WebApplication




Then perform an IISRESET. Next, do something to break SharePoint (how many time will you here that request?) and test out your error message.

At any point, you can set the error page back to the default by running the following command and then IISRESET:

Set-SPCustomLayoutsPage -Identity Error -WebApplication -Reset




Download the Custom Error Page

Source: http://www.tcscblog.com

No comments:

Post a Comment