Monday, July 30, 2012

Easily embed Youtube videos, Javascript, styles and other markup into a SharePoint 2013 page with the Script Editor WebPart

Instructions below are executed within a Team Site template:
  1. Select the ‘Edit’ icon in the top right corner of the page to edit the page

    EmbedCode0
  2. Select ‘Page’ in the ribbon, click ‘Embed Code’

    EmbedCode
  3. Enter some script, styles, embed code,… in the editor box

    Javascript example
    EmbedCode2

    Youtube example
    EmbedCode3

    EmbedCode4

    Notice the preview of the embedded video
  4. Click ‘Insert’
  5. Save the page with ‘Save & Close’ in the top right corner.
Some remarks:
  • After clicking ‘Insert’, a Script Editor WebPart will be automatically inserted into the page - only if you’re using embedded code.

    ScriptEditorWebpart
  • Default Chrome type is ‘None’
  • The Script Editor WebPart is also available as webpart under ‘Media and Content’

    EmbedCode5
  • You can still use the Content Editor Webpart to achieve the same results. The main difference between the two is that the Content Editor WebPart  is more focused to  enter rich text content, while the new Script Editor WebPart is more focused to insert HTML snippets and scripts.

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.