How to create a unique ID for a SharePoint 2007 List or Library

5280 Solutions provide a great tutorial to help create a fully working unique ID and associate it to a SharePoint list or library


Custom templated list control – SharePoint Designer

Yesterday I created a custom templated list control which I now have working on the dev image. This shows the content of a SharePoint list in a HTML template of your choice. In this case I have created two lists at the root level called MenuItems and DropDownListItems, both of which have two columns, Title and URL. I can then put the following in the master page:

Create the top horizontal menu:

  • <a href="”>

Create the drop-down list:

I want to

– Select –

<option value="”>

In order to deploy this I have had to alter the web.config to add the control to the SafeControls collection, and in order to allow a templated control to run I had to also change the SafeMode collection:

This is saying allow server side script (which is what Sharepoint classes templated controls as) to run on the chris.master master page. If we are not going to allow this in the live environments let me know and I will have to develop a separate control for each, i.e. a menu control, drop down list control, bulleted list control, and so on.

Workflows – Visual Studio vs SharePoint Designer – a quick comparison

I wanted to compare and contrast when you’d use SharePoint Designer to author workflows in MOSS 2007 to when you’d rather use Visual Studio 2005 – with WF designer.
Both products can do the following:Author workflows for use in WSS.Generates a workflow markup file that’s stored in the database.
So where do the two products diverge?

Visual Studio 2005 (w/ the WF Designer)
SharePoint Designer 2007
Can create code-behind file(s) that allow you to add any custom code (C#/VB.NET) to your workflow.
Couldn’t find any code-behind support.
Can design workflows as a template to be associated with various lists and sites.
When authoring a workflow, it’s bound to specific lists/sites at design time.
Compiles the workflow compiled into an assembly and deployed to the server.
Everything is persisted in markup and stored in a document library in the target site.
Use the browser UI to associate a workflow with a list to make it available to that list.
Association occurs at design time.
Can associate workflows with content types.
Not possible in SPD.
Can include InfoPath web enabled forms as a data collection vehicle via Forms Server.
ASP.NET 2.0 ASPX pages are built automatically at design time, but you can customize them after they’ve been generated.
Can modify your workflow
Not sure if you can modify your workflow
Manual deployment (via a SharePoint Feature).
Automatically deployed at design time.
Rich debugging support.
No debugging support.
Supports building sequential and state machine workflows.
Can only build sequential workflows.

Changing the SmallSearchInputBox delegate control

A colleague of mine was wanting to make some changes to the SmallSearchInputBox delegate control in SharePoint 2007. That’s the control that appears on most pages, looking like:

This control is a ‘Delegate control’ – that is, you can create features to override the currently used control. What my colleague wanted to do was not display the ‘Scope’ drop down list, the Advanced Search link, and to include prompt text (something like ‘Enter Search…’). A quick dig into the FEATURES folder in 12 Hive showed that the control had a number of properties.
(The features that this information applies to are the OSearchBasicFeature and OSearchEnhancedFeature. Both contain files called ‘SearchArea.xml’, and that contains the code below. I found the folders with this in:
%12 Hive%\Template\Features\OSearchBasicFeature
%12 Hive%\Template\Features\OSearchEnhancedFeature )


This shows a property ShowAdvancedSearch which sounded pretty promising for turning off the Advanced Search link. We decided to see what other properties were available, and found a good article by Clint Cherry about the SmallSearchInputBox control, and the MSDN docs. The Property tags in the XML for the delegate control set the properties of the web control class – e.g. GoImageUrl matches the GoImageUrl property on the class. Much to our pleasure, we found the QueryPromptString displays text in the search control which vanishes when it receives focus, and the DropDownMode property allows us to turn off the scope dropdown list. Hurrah!
For the values that you can set the drop down mode to, see the MSDN docs again

Workflow Development for Windows SharePoint Services

While Windows SharePoint Services 3.0 includes pre-built workflow templates, you can also create your own workflow templates. You can use either Visual Studio 2005 Designer for Windows Workflow Foundation, or a declarative rules-based, code-free workflow editor, such as Microsoft Office SharePoint Designer 2007. Because each authoring tool produces workflows with different attributes and capabilities, it is worth examining each tool in detail.

Using the Visual Studio 2005 Designer for Windows Workflow Foundation

In Visual Studio 2005, you can use the Visual Studio 2005 Designer for Windows Workflow Foundation to create workflow templates and custom workflow activities. You can include code in your workflow, as well as design forms to be used by the workflow to communicate with the workflow users during association and runtime. It is worth noting that when you are developing workflows templates in the Visual Studio 2005 Designer for Windows Workflow Foundation, you are not programming against a specific SharePoint site.
Using Office SharePoint Web Designer

By contrast, when you are creating a workflow in a declarative rules-based, code-free workflow editor, such as Office SharePoint Designer 2007, you are designing a workflow for the specific SharePoint site in which you are working. Office SharePoint Designer 2007 provides a user interface that enables you to create declarative rules-based workflows for the selected site. With Office SharePoint Designer 2007, you are in effect assembling pre-existing activities into workflows.

You cannot create your own activities in Office SharePoint Designer 2007; nor can you write code-beside files. Using Office SharePoint Designer 2007, you create and deploy XML-based markup files, rather than an assembly that contains code.

Comparing Workflow Development Processes

The figure below illustrates the various steps that need to be performed to create, deploy, associate, and run a workflow using each of the authoring tools. In general, the largest difference between the two tools is this:

Workflow authoring in the Visual Studio 2005 Designer for Windows Workflow Foundation is performed by a professional developer, who is creating a workflow template that can be deployed across multiple sites, and contains custom code and activities. The developer then turns the workflow template over to a server administrator for actual deployment and association.

Workflow authoring in Office SharePoint Designer 2007 is likely done by someone other than a professional developer, such as a web designer or knowledge worker, who wants to create a workflow for a specific list or document library. In this case, the designer is limited to the workflow activities on their ‘safe list’, and the workflow cannot include custom code. The workflow author deploys the workflow template directly to the list or document library as part of the workflow authoring process.

Although the steps in the workflow creation process are specified by role and application, obviously the same person can perform more than one function, based on your business processes. For example, the same person might develop the workflow in Visual Studio 2005 and install it on the server using Windows SharePoint Services 3.0.