SharePointage

Developing with SharePoint

Placeholder Image Generator from lorempixel

leave a comment »

 

This randomly generated image brought to by lorempixel.com:

lorempixel is an elegant tool for generating random placeholder images. The ‘api’ is embedded in the url path and allows you to dictate the size, category and text of the image. Brilliant!

Written by markm247

January 30, 2012 at 5:38 pm

Posted in Uncategorized

SharePoint 2007 “An unexpected error has occurred” After Content Database Restore

leave a comment »

If you experience the generic “An unexpected error has occurred” message after a content database restore (or any reason really), the first step in troubleshooting is to turn off custom error handling and allow SharePoint to display the stack trace. Here are the steps:

1) Navigate to the web application’s web.config file

2) Find the SafeMode setting:

<SafeMode MaxControls="200" CallStack="false" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false">

and change the ‘CallStack’ and ‘AllowPageLevelTrace’ attributes from false to true:

<SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="true">

3) Find the CustomErrors setting:

   <customErrors mode="On" />

and set mode=”Off”:

   <customErrors mode="Off" />

Now reloading the page will provide stacktrace information for troubleshooting.

Written by markm247

January 16, 2012 at 10:15 pm

Posted in Uncategorized

The Status code is “OK” in SharePoint Designer 2010

leave a comment »

Attempting to open a SharePoint 2010 site on a staging server our consultants built resulted in the following error:

An Error occurred while trying to fetch data from your SharePoint site. Unexpected response from the server. The content type of the response is “”. The Status code is “OK”.

Doing some ‘research’, it appears that there are several possible causes, but in my case it was due to an issue with multiple IIS bindings on the web application. Taking the always awesome Clayton Cobb’s advice, I extended the web application and used the new URL to connect to the site. Worked like a charm.

Written by markm247

June 21, 2011 at 10:05 pm

Posted in Uncategorized

Silverlight Error ‘Element is already the child of another element’ When Adding Control in LightSwitch

leave a comment »

Working with LightSwitch Beta 2 and trying to add a custom grid control from DevExpress. I added a custom Silverlight user control to the Client project and then changed my LightSwitch Grid Screen grid to ‘Custom Control’ and pointed to the user control I had created. The solution would build fine but when attempting to debug, I would get the following error:

Element is already the child of another element. [Line: 0 Position: 0]

The solution was to add the DevExpress dll as a reference in the ‘Add Custom Control’ dialog box used to select your custom control. The quirky part is that you don’t actually select the dll as the custom control (you pick your user control), but it has to be added through the same interface…

Credit to Paul Patterson for his solution here.

Written by markm247

May 17, 2011 at 9:30 pm

Posted in Silverlight

Improving Workstation Performance When Developing Sharepoint 2010 on Windows 7

leave a comment »

 

There’s quite a bit of debate about the plusses and minuses of installing SharePoint 2010 on Windows 7 for development… But if you go that route (as my team and I have), I just ran across this post from Emmanuel Bergerat with PowerShell scripts to start and stop all necessary services on your machine:

Click to Follow

Excellent work Emmanuel, but this surfaced a minor annoyance I’ve had for a while about the inability to right-click and select ‘Run as Administrator’ when launching a PowerShell script… A little googling and I found a PowerToy written by Michael Murgolo back in 2008. Took me a few minutes of reading, so here are the cliff notes:

1) Download Elevation2008_06.exe (a zipped exe)

2) Run the exe and unzip the files into a folder

3) Open the Elevation folder installed by the exe

4) Right click on the ElevatePowershellScript.inf file and select ‘Install

5) Right Click on the ‘START Sp2010 on Local DevWorkstation.ps1’ file from Emmanuel and select ‘Run as Administrator’

Written by markm247

October 28, 2010 at 4:40 pm

Posted in Uncategorized

The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered

leave a comment »

I ran into an issue yesterday on my SharePoint 2010 development environment: when starting the SharePoint 2010 Powershell tool (officially the SharePoint 2010 Management Shell), I received the following error:

The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.

I found several articles with suggestions here and here. Having the appropriate SQL Server access is required but neither approached worked for me. When I came in this morning it occurred to me it may be easier than I’m making it.

The resolution for me was starting the tool as an administrator by right clicking on the icon:

image

Written by markm247

August 13, 2010 at 8:58 pm

Posted in Uncategorized

SharePoint List Filter by User

leave a comment »

If you’re need to try to filter a SharePoint list to show only items created by the current user, Microsoft guidance is less than optimal.

The more straightforward approach:

  1. Navigate to the view you want filtered and select ‘Modify this view’ from the View dropdown (or create a new view)
  2. In the ‘Filter’ section, add a filter where ‘Created By’ field is equal to ‘[me]’

image

That’s all there is to it. Hope this helps anyone looking.

Written by markm247

July 20, 2010 at 4:44 pm

Posted in Uncategorized

TFS 2010 Web Services

leave a comment »

fail owned pwnd pictures

If you’ve reached my blog by googling for the last hour searching for information on web service documentation for Team Foundation Server 2010 (as I just finished doing), I’ve got some bad news for you… Here’s a link to an MSDN forum posting titled ‘Getting work items via TFS web services’. In essence, it explains that: 1) there are TFS web services and 2) they’re impossibly hard to use, so don’t bother (the exact advice is use the client object model).

I can’t recall a time I’ve been more disappointed with a Microsoft development tool (ok, I’m probably wildly blinded by the present tense) and surprised by the irony of a tool dedicated to enabling developers to be more productive, providing such an obtuse approach to integration.

Thanks Microsoft. Smile with tongue out

Written by markm247

July 15, 2010 at 11:29 pm

Posted in Uncategorized

Windows 7 SharePoint 2010 Install

leave a comment »

Good news for SharePoint developers of the world: SharePoint 2010 can be installed directly on a Windows 7 OS. There are still plenty of compelling reasons for utilizing a VM and you have to have meet the hardware requirements, but you have to love having the option. I’m going for it and installing on the my development workstation.

Here’s a link to the Microsoft guidance on setting up a SharePoint 2010 development environment.

Written by markm247

June 29, 2010 at 9:00 pm

Posted in SharePoint 2010

SharePoint Calculate Days Hours & Minutes Between Dates

leave a comment »

 

pocketcalendar1400

A request today sent me Googling for a calculated column formula to display the days/hours/minutes between the created date and modified date of a list item. I found nothing so here’s what I came up with:

 

=IF(DAYS360(Created,Modified)>0,IF(((HOUR(Modified)*60)+MINUTE(Modified)>((HOUR(Created)*60)+MINUTE(Created))),DAYS360(Created,Modified),DAYS360(Created,Modified)-1),0)&" Days,"&HOUR(Modified-Created)&" Hours,"&MINUTE(Modified-Created)&" Minutes"

 

The resulting columns look like this:

image

 

Since the engine used for calculated columns is the same as Excel, I always start in Excel when I’m writing complex column calculations. I then find and replace the cells in the formula with the SharePoint column names and paste the formula to SharePoint.

Hope this helps if you’re looking to do the same…

Written by markm247

May 24, 2010 at 10:51 pm

Posted in Tips

Follow

Get every new post delivered to your Inbox.