Saturday, June 23, 2012

SharePoint Sucks – And Here’s Why...

What would you do when you see this message?

unexpected-error

A) Stay calm, try to copy the correlation ID, notice that you can’t copy it and still stay calm, write it down on a piece of paper and track it in the ULS logs

B) Open your browser, go to a search engine and type “SharePoint sucks” to let off steam

If you have chosen option B, you’ll probably encounter the funny blog series of Bjørn Furuknap. Give it a read, they are a bit outdated but there’s still a lot of truth in it.
Ow, btw, I didn’t search after “SharePoint sucks” – it was a colleague who mentioned the blog series. He has probably chosen for option B. Ok, to be honest, there are days that I hate SharePoint too. I have some sort of love/hate relationship with it.

Let me end this post with a funny quote of Bjørn Furuknap.
Over the past couple of weeks, I’ve said quite a lot of things about SharePoint that may lead you to think I hate SharePoint. I don’t. Quite the contrary, I love SharePoint. Yeah, it sucks, but so does my wife, and I’ve married her twice.

Sunday, June 17, 2012

Quick Tip: Approval Workflow - Due date for all tasks

Within the association form of the approval workflow you are able to set the “Due Date for All tasks”. This setting specifies the date by which all tasks are due.

What if you want tasks to become due on a specific time on a specific day? In the user interface of the association form you are not able to specify a time value.

DueDateForAllTasks

Although it is nowhere documented, it is possible.

For example, if you want to terminate all tasks on the 18th of June at 13h30 you can set the following value in the textbox:
2012-06-18T13:30:00

Use the following structure to set a time value:
yyyy-mm-ddThh:mm:ss

I know, it’s not really user friendly, but it works. You can probably use SharePoint Designer to tweak the association form to implement some extra logic.

One of the best references online about approval workflows in SharePoint 2010: All about approval workflows

Wednesday, February 29, 2012

Export Farm Solution Package with PowerShell

Follow the steps below to export a farm solution package…

1. Open a text editor – such as Notepad.
2. Paste the following code snippet:

$farm = Get-SPFarm
$file = $farm.Solutions.Item("MySolutionPackage.wsp").SolutionFile
$file.SaveAs("c:\MySolutionPackage.wsp")

3. Replace the highlighted text above with the name of your solution package.
4. Save the file - give the file a name and save it with the extension ps1 (eg. extract.ps1) and place the file on the C:\ drive.
5. Open the SharePoint 2010 Management Shell
6. Navigate to the location of the script and execute it.
7. The solution package will be available on the C:\ drive


Update: If you want to download all the solutions at once you can use the following script:
$dirName = "C:\Solutions"
foreach ($solution in Get-SPSolution)
{
$filename = $Solution.SolutionFile.Name
$solution.SolutionFile.SaveAs("$dirName\$filename")
}

Thursday, February 16, 2012

Error: The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service...

This error can be encountered while viewing an InfoPath form in the browser. In most cases, the problem can be solved by reading through the following blogpost.

In my case, the state service was enabled and the service application was correctly associated with the webapplication. I solved this by deleting the 'corrupt' state service database, creating a new one and attaching the new database to the farm - all these steps can be done with some Powershell commands.


Friday, September 9, 2011

Reserved Querystring Parameters In SharePoint

This is probably the 100th post on the net about...
"Be careful when naming querystring parameters in your SharePoint applications"

But you can't say it enough. They cause trouble!
For more info read this.

Wednesday, September 7, 2011

Could not access the Search administration database. A generic error occurred while trying to access the database to obtain the schema version info.

Deleting the following registry key - did the trick for me:

“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\WSS\Services\Microsoft.SharePoint.Search.Administration.SPSearchService”

In fact, it's just one of the things that need to be verified.
Read this post for more info.

Saturday, June 11, 2011

Default location picture upload in RTE

If you want to insert a picture in the rich text editor directly from your computer, you will notice that the RTEUploadDialog pops up in which you can browse for a file and select a location.

!cid_image001_png@01CC25D2!cid_image002_png@01CC25D2

Unfortunately, you can’t set the default location.

Workaround

Option 1: Because the “Upload to” dropdown list is filled up alphabetically, you can rename the library you want (eg. let it start with an underscore).

Option 2: (Not supported by MS) You can write some javascript to select another default value for the dropdown list. Insert your javascript into the RTEUploadDialog application page (/_layouts/RteUploadDialog.aspx).

As far as I know, this page is not only used for uploading images, so you probably have to take into account the querystring parameter ‘Dialog’ (/_layouts/RteUploadDialog.aspx?LCID=1033&Dialog=UploadImage).