Custom field and UpdateFieldValueInItem()

Recently I was developing a custom field. To store modified values, the UpdateFieldValueInItem method has to be overwritten. In a normal way of clicking the submit/save button, the method is called and I can adjust the value for the field within the current item. The changes are submitted to the database later. But what if you want to modify items outside of the current item? Sure, you can do so would you think.

Creating a lookup field via elements.xml

This is another post to help me remember. And as a reference for all of you, who cannot remember how to create a SPFieldLookup via XML. <Field ID="{8b26ec41-b6c3-4327-0066-0c18c0768626}" Name="InternalName" StaticName="InternalName" DisplayName="Display Name" Type="Lookup" ShowField="Title" Mult="TRUE" List="Lists/LookupList" Overwrite="TRUE" /> When you provision a SPField via features, do not forget to add Overwrite=”TRUE”! Otherwise you’ll get an exception like this: 0x8107058aFehler beim Binden des Inhaltstyps ‘0x010200C7A18EB120BB4A00892E9E1EE9481C9B0067E475B6FDD54048B347370871443CAD’ an die Liste ‘/sites/rhtest/Lists/LookupList’ für ‘http://rhdevsp2013/sites/rhtest’. Ausnahme ‘0x80070057’.

What is Dependency Injection?

This post will help you understand what DI (Dependency Injection) is, and how easy you can adopt the design patterns to create flexible and testable code. For a definition take a look at this Wikipedia article. From the three types of Dependency Injection constructor injection setter injection interface injection this post covers the interface type. The example will deal with a SharePoint list. This list can either be the posts list of a blog, or the comments list.

Migrate SharePoint Blog to WordPress

As promised here, this is a follow-up post with the tool I developed for the SharePoint to WordPress migration. First, a screenshot: What is it, that we have to cover with a migration? Copying the posts is not enough. So I came up with this features: Features Copy posts Copy comments Copy resources like images and downloads Create needed tags and categories Modify links to local resource deal with https, if links are absolute on the source blog and mixed with http Using web services to connect to source and destination URL rewriting (covered by a WordPress Plugin) Delete all content from the destination blog (for migration testing) Replace strings (with Regex) a nice (WPF) GUI Description Originally I’ve build a plain console application.

ChangePassword Webpart – new version available

The ChangePassword WebPart on CodePlex has been downloaded over 20.000 times. The new version has a couple of new features: Easy Installation SharePoint 2010 and 2013 (Foundation and Server) Password strength indicator Plugin support to extend functionality by custom code1 Warning if an unsecured connection is used Copyright hint can be removed1 Auditing of password changes (and attempts) Logging into the SharePoint logs This is how it might look on your SharePoint:

A new home for this blog

After many years of SharePoint as blogging platform, I decided to move to WordPress. There are several reasons for the decision. One would be that I want to get rid of my server at home. Another is SharePoint and its blogging capabilities. As you probably know, I’ve worked on the CKS:EBE (Community Kit for SharePoint – Enhanced Blog Edition) blogging extension for SharePoint blogs some years ago. It is awesome to see that the default blog can be extended to such an extend.

TFS Migration from On-Premise to Visual Studio Online

Having a server at home that hosts a TFS is nice. But really necessary? Not really. So I decided to move all my sources to Visual Studio Online. Visual Studio Online Basic is free for the first 5 users. That’s enough for me. The migration process is straight forward easy with a tool that is installed on my computer. The process is described here. Another post can be found here.

Using TLS with SmtpClient

A rather small change to your code can increase security by sending E-Mails via an encrypted connection. Recently I stumbled across code, that send E-Mails with the System.Net.Mail.SmtpClient class. That piece of code did not try to communicated encrypted with the receiving SMTP server. So I changed that, to enable a TLS connection. try { var message = new MailMessage(); _smtpClient.EnableSsl = true; _smtpClient.Send(message); } catch (SmtpException ex) { // if the recpient mailserver does not support SSL, send without encryption _smtpClient.

Useful JavaScript to know when working with SharePoint Display Templates

This post has some really great examples for JavaScript helper methods and available properties for working with Display Templates in SharePoint 2013. http://dotnetmafia.com/blogs/dotnettipoftheday/archive/2014/02/26/useful-javascript-for-working-with-sharepoint-display-templates-spc3000-spc14.aspx If you ever had to decide if your script is running on a SharePoint Foundation, use this one: // Determine if the host is SharePoint Foundation if (!Srch.U.isSPFSKU()) { }

SharePoint App Deployment fails

Visual Studio does not tell you much if an app deployment fails. Fortunately SharePoint will log more information about the problem that occurred during the app deployment in the ULS-Log. So if you run into the “There were deployment errors.” exception, take a look at the ULS-Log. In this particular case SharePoint didn’t like my JavaScript: App Packaging: CreatePackage: Unexpected exception: There were errors when validating the App package: There were errors when validating the App Package.

The solution for warming up SharePoint

Most SharePoint Farms will have a solution for the long loading time after an Application Pool recycle or iisreset running. There are many different ways to preload websites, so your users have faster load times. So why another solution? There are some questions, that I think have not been dealt with before: Most solutions require some sort of Timer to be started (e.g. a Scheduled Task) When should the warmup occur?

Hatte ich schon erwähnt

das ich wieder als Speaker auf der BASTA am 26.2. in Darmstadt dabei bin? Mein Vortrag hat das Thema SharePoint-Performance aus der Sicht eines Entwicklers. http://basta.net/2014se/

SharePoint 2013 SDK

How could I miss the release of the SharePoint 2013 SDK in November? http://www.microsoft.com/en-us/download/details.aspx?id=30722 Anyway. Finally the non-preview version has been released 🙂

Building a Visual Studio project for SP2010/SP2013 (.NET 3.5/4.0)

In this post I will show you how you can use MSBuild to target your project for .NET 3.5 or .NET 4.0 and use a separate app.config file for each. My Warmup Tool is supposed to work with SP2010 and SP2013. To achieve that compatibility, I have to change the TargetFramework of the project to be able to compile, as well as the app.config so the application uses the desired Framework.

Speed up SharePoint Update Installation

Installing Updates for SharePoint 2013 will take a long time, if you don’t disable some services prior starting the update process by executing the hotfix exe file. To simplify the installation, and speeding it up, you can use a PowerShell script to stop the necessary services, and start the update. http://blogs.msdn.com/b/russmax/archive/2013/04/01/why-sharepoint-2013-cumulative-update-takes-5-hours-to-install.aspx You need to copy the code, and save it as e.g. Install_SharePoint_Update.ps1 in the same folder as the exe file.