Nick Grattan's Blog

About Microsoft SharePoint, .NET, Natural Language Processing and Machine Learning

Archive for the ‘SharePoint Designer’ Category

Creating While Loops in SharePoint Designer Workflows using Stateful Workflows – Part 2

with 3 comments

Here’s some additional information to this post about this subject.

An alternative to our solution for while loops in SharePoint Designer workflows have been previously proposed based on setting a workflow to start when an item is changed. This gets over the problem of how to get a workflow to restart itself (which we do with the “Restart This Workflow” action). You can find a description of how to do this here:

However, the technique of a workflow restarting itself when an item changes will not work with SP2. Take a look at this Microsoft post:

In SP2 a workflow cannot restart itself recursively, and so this will break stateful workflows written in this way. Seems strange that Microsoft would introduce a breaking change when using these techniques have been well documented.

Written by Nick Grattan

October 7, 2009 at 12:40 pm

Creating While Loops in SharePoint Designer Workflows using Stateful Workflows

with 14 comments

For an update on this topic please see this blog entry:

Amongst several significant limitations with SharePoint Designer workflows, perhaps the most important is the lack of looping. Therefore, expressing processes like “while not approved, rework” becomes difficult.

We have published a paper that describes how to implement while loops by emulating stateful workflows in Microsoft SharePoint Designer. You can download the paper here (PDF, Oct 2009). The technique uses our “Restart this workflow” custom action, which is part of our “Custom Activity Pack” which can be downloaded here for free.

Update: 10-Nov-2013. Source code and WSP now available in GitHub:

Written by Nick Grattan

October 6, 2009 at 10:00 am

Custom Workflow Action: Send to Records Center

with 7 comments

Our Custom Activity Pack contains actions that can be installed for use in Microsoft SharePoint Designer workflows. The latest version includes an action for sending documents and items to a Records Center site collection directly from your workflows.

The Custom Activity Pack is free and can be downloaded from GitHub:

Other custom actions in this pack include:

  • Start Workflow – Start another workflow for the item or document and return.
  • Call Workflow – Start another workflow and wait until that workflow has completed.
  • Halt Workflow – Halt another workflow executing against the item or document.
  • Restart This Workflow – great for implementing stateful workflows in SharePoint Designer
  • Is Workflow Running – check if another workflow is running against the item or document.

Here is the entire list of actions:


Written by Nick Grattan

October 1, 2009 at 5:18 pm

Microsoft SharePoint Designer Download Now Free!

leave a comment »

Written by Nick Grattan

April 24, 2009 at 9:26 am

Increasing size of Rich Text Editing Control

with 6 comments

When using the rich text column type in SharePoint lists the edit control has a fixed width of 384 pixels. This is often too small for easy editing.

The width of the control used to edit rich text is set through the ms-rtelong style. You can change the width using the style in the core.css or other style sheets you may be using. However, this will change the width for every use of this control in your site.

If you need to change the width for a single form, open the form in SharePoint Designer and add a style defining ms-rtelong at the top of the content place holder in which the form is displayed with new dimensions, e.g.

<asp:Content ContentPlaceHolderId=”PlaceHolderMain” runat=”server”>

<style type=”text/css”>
.ms-rtelong {

You can do this for standard uncustomised forms (e.g. NewForm.aspx) or for pages you create using the custom list form web part.

Written by Nick Grattan

December 1, 2008 at 3:50 pm

SharePoint Designer: Clearing the Web Part Cache

with one comment

When developing web parts (say in Visual Studio 2008) and using these web parts in SharePoint Designer 2007 you may find that your property definitions are not refreshed in SharePoint Designer. For example, if you add a new property in VS 2008 and recompile, the new property may not not displayed in SharePoint Designer.

To remedy this you can clear SharePoint Designers web site cache:

  • Navigate to {my profile}\AppData\Local\Microsoft\WebsiteCache
  • Locate the folder that relates to the web site you’re using (server name + port)
  • Delete the contents of the folder.

You will find a file in this folder called {webpartproject}.Proxy.DLL. If you cannot delete this file because it’s in use just rename it.

Now, when you next run SharePoint Designer you’ll get a refreshed list of web parts.

Written by Nick Grattan

November 3, 2008 at 10:17 am

Hiding the Search Box When Printing

leave a comment »

Ever noticed that the search box is shown on a SharePoint page when printed while other parts of the page are hidden?


The Search box can be hidden, along with other parts of a form you don’t want printed by using styles. This can be done using Microsoft Office SharePoint Designer:

  • Open the master page in SharePoint Designer
  • Add the following style either to a CSS file included in the master page or as a style within the master page itself:

@media print{

  • Locate the delegate control used to display the search box and add the code shown in italics:

    <asp:ContentPlaceHolder id=”PlaceHolderSearchArea” runat=”server”>
    <span class=”HideForPrinting”>
    <SharePoint:DelegateControl runat=”server” ControlId=”SmallSearchInputBox”/>

This defines a span that uses the style HideForPriting, the content of which will be hidden when the page is printed.

Written by Nick Grattan

October 1, 2008 at 8:07 pm

Changing Page Used to Display Items in a List

with one comment

When displaying a view on a list (such as displayed with “AllItems.aspx”) the “Title” hyperlink for an item will redirect you, by default, to the “DispForm.aspx” page with the ID passed as a query parameter.


There are times when you may need to change the page used in the link, for example:

  • When you have your own custom page for displaying an item.
  • You want the take the user directly to editing an item rather than displaying an item.

The default page can be changed using SharePoint designer. To do this:

  • Run SharePoint Designer and open up the site in which the list resides.
  • Right click the list and select Properties.
  • Select the Supporting Files tab.


  • Ensure to select the correct “Content Type”, e.g. “Items” – note that in the above case it defaults to “Folder”.

From this dialog, you can use the appropriate Browse button to select the file to use for the “Display”, “New” or “Edit” operation.

NOTE: The URL shown in the browser (see first figure) will still show “DispForm.aspx” but clicking the link for an item will navigate correctly to the page you select.



Written by Nick Grattan

May 29, 2008 at 8:42 am

Bulk Editing of SharePoint List Items

with 5 comments

Imagine you have a list with a “Confirm” yes/No field and you want a user to be able to view items and click a Check box on those items which are completed and click a Save button:


This saves the user opening each item in turn, changing the “Confirm” field and saving the item. This can be done using the SharePoint Designer and using a DataView. To do this:

  • Select File + New + Page to create a new ASPX page.
  • Choose “Create from Master Page…” and click OK and OK again to use the default master page..
  • Save the page as “BulkEdit.aspx” in the list’s folder, e.g. “ConfirmList” where the existing AllItems.aspx file exists.
  • “Create Custom Content” for “PlaceHolderMain” using the quick link:


  • Open the “Data Source Library” pane and click the list, e.g. “ConfirmList” and select Show Data:


  • Select the Insert Selected Fields as… button in the Data Source Details panel and select Multiple Item Form:


  • From the “Common Data View Tasks” menu select Edit Columns and remove all columns bar “Title” and “Confirm” (or whatever columns you want displayed).

You will now set the “Title” column to be read-only so that only the “Confirm” check box is editable.

  • Single click a “Title” edit box and click the “Common FormField Tasks” button (the greater than sign) and select “Text” from the “Format as” list.
  • Save the file.
  • To test, navigate to the page, e.g. TestSite/Lists/ConfirmList/bulkedit.aspx.

Also take a look at, this uses an XML file as the data source rather than a SharePoint list.

Written by Nick Grattan

May 13, 2008 at 12:13 pm