Extending Lookup Fields with “Add new item” option

How many times were you working with Lookup Fields and just when you were about to pick a value, you found out that it’s not there. How many clicks did you have to make to get to the Lookup List, add the new Lookup Item, get back to where you were first and add your item? While it sounds trivial, it’s the only way things can be done in out of the box SharePoint. You could of course create a whole new Custom Field Type which would contain an “Add new item” link, but there is an easier way to get this done.

Generate your own SPBuiltInFieldId class

SharePoint ships with the SPBuiltInFieldId class which allows you to access the ID’s of all the out-of-the-box available fields using intellisense. This is very important in scenarios when your solution heavy relies on custom development and working with list items. The SPBuiltInFieldId class makes working with Content Types and Columns easier: instead of typing the names you can use the Properties of the SPBuiltInFieldId and get to all the standard SharePoint fields using intellisense.

Visual Studio T4 template for SharePoint Feature Definition (Feature.xml)

Recently I wrote an article about automating the generation of the DDF files used to package SharePoint Solutions. In my example I used a custom Visual Studio T4 template to generate the DDF file. As a scenario I used a Web Content Management (WCM) solution, which contained a lot of assets to be provisioned to SharePoint. While working with WCM solutions generating and maintaining the DDF files is not the only challenge. As all the different assets are being provisioned using Features you also have to maintain two more files: Feature.xml and Elements.xml. Once again the T4 templates can help you get the job done.

Programmatically creating Wiki Pages

Recently I had to prepare a demo for one of our customers. Next to the regular things like provisioning sites and lists I had to provision a Wiki Pages Library with some demo pages in it. Although you might expect a Wiki Library to be a regular list it is not and programmatically creating Wiki Pages is slightly different than creating regular items.