Alert This post is over a year old, some of this information may be out of date.

Order List Items Like in a Meeting Workspace: Part 1

January 3, 2012

As you may or may not know, there is functionality in the Meeting Workspaces to reorder the discussion points on the agenda. This functionality enables you to change the order of the discussion points, but you can also enable this functionality on other lists. It requires some manual steps which are explained in this blog post.

Change Item Order
Change Item Order
Change Item Order Form
Change Item Order Form

In this blog post I show you how you can enable this reorder functionality on other list/libraries.

First of all you need to make the Order field visible inside your list. To make this field visible, you can use the following PowerShell script.

$url = "Web_URL"
$site = Get-SPSite($url)
$web = $site.OpenWeb()
$list = $web.lists["List_Name"]
$orderField = $list.Fields["Order"]
$type = $orderField.GetType()
$mi = $type.GetMethod("SetFieldBoolValue", [reflection.bindingflags]"nonpublic, instance")
$parameters = "CanToggleHidden", $true
$mi.Invoke($orderField, $parameters)
$orderField.Hidden = $false

Note: before you execute this script, change the Web_URL and List_Name in the PowerShell script.

When the field has been unhidden, you can check the list columns. Normally the Order field should now be visible.

Order Field Visible
Order Field Visible

The Order field will not be visible on item forms, or you must enable it by code or PowerShell script (which is not recommended).

From this moment on, each time you create a new item, the order field automatically increments the order value. To check this you can make this Order column visible in a SharePoint list view, and you can also set the sorting setting to sort by the Order column.

Sort by Order Column
Sort by Order Column
Order Values
Order Values

You can change the order by navigating to the following URL:

Change Item Order Page
Change Item Order Page

Changing the order results in changes to the Order field value.

New Item Order (Check Order Values)
New Item Order (Check Order Values)

Part 2

In the next part I will show you how you can create a custom action with SharePoint Designer to reorder the items.


comments powered by Disqus