Thursday, November 25, 2010

Edit initial text in TFS WorkItem User Story

The popular “As a <type of user> I want <some goal> so that <some reason>” is always the initial text in a user story work item.

When a WorkItem is opened in VS2010 the editor switches to a custom editor (<Witd:WITD application="Work item type editor")

The safe way is to use this editor

The value is not defined as the default value for the Description field. It is defined in the workflow for the workitem.

Start by choosing the Workflow tab

WIT_Workflow

Double click on the first transition (The one to the left)

Choose the fields tab and double click on the System.Description

WIT_Transition

Select the Rules tab, and double click on the DEFAULT entry

SNAGHTML35e1cc4

Edit your initial text

SNAGHTML3614dd3

You can also edit the XML file outside a the custom editor

It can easily be changed by taking a look in the XML (as XML not WIT in Visual Studio 2010) The text is located at line 177 in the XML file.

Friday, November 12, 2010

Custom List Form with version history

When turning on version history on a list that is using custom list forms the text entered in a multiple line textbox is not displayed. when the field is in Display mode. The text just seems to be lost in the database. But by examining the version history for the item you will see all the changes.

The solution is simple:

In order to display the history use another control type, use the <SharePoint:AppendOnlyHistory/> instead of <SharePoint:FormField/>

By using this control you will get a nice list of all the field versions.

And by combining the two you can get a field that displays the history, and at the same time give the possibilities to edit the text:

TFS_Bug_with_history_full

Tuesday, November 9, 2010

Cannot reference …WorkItemTracking.Controls

When developing custom WorkItem Control Types you must reference Microsoft.TeamFoundation.WorkItemTracking.Controls But the filtered list of assemblies does not display the assembly despite the fact that it is in the GAC (C:\Windows\Assembly)

There are multiple ways of retrieving the correct reference, one is to use the Muse.VSExtensions.

This extensions lists all assemblies in the GAC and allows you to add an assembly as a reference

Add_GAC_Reference

Tuesday, November 2, 2010

IsDlg=1 numeric value is not validated

When using SP.UI.ModalDialog.showModalDialog(…) you should set the parameter IsDlg to 1 when calling a List Form (View/Edit/Create) this removes all references to masterpage items such as quick launch etc.

Keep in mind that the numeric value entered after the IsDlg has no effect, so setting IsDlg=0 is the same as IsDlg=1 SharePoint only checks for the existence of the variable IsDlg and does not check if the value is set to anything. So leave out the IsDlg entirely when the page is loaded without popup windows