Showing the Risk or Issue Id’s in the workspace edit and display forms

It’s always puzzled me why Microsoft never did show the ID of a SharePoint based list entry in the edit or display form. What do I mean by that? Well, out of the box, when you create a list in SharePoint, each item has an ID associated. This ID is then used to identify the individual records in the list.  Once you have created an item in the list you can see the ID in the view

Issue ID on the view

But not in the edit or display views of the list item.

Default display formDefault Edit Form

Now this is not unique to Project Server 2010, nor SharePoint 2010 for that matter. The same behaviour can be seen in SharePoint 2007 as well. So why am I telling you all this, well today one of my clients requested that the risks and issues lists on their Project Server instance be modified to show the actual id of the item, making it easier for them to reference and relate to the information they were viewing.

Well, it turns out doing this is pretty easy. Basically all that is needed is to add a content editor web part to the the Display and Edit forms and add a small piece of JavaScript to render the relevant ID. A quick search on the web revealed this article from PathToSharePoint.com that provides the code as well as steps to insert the Content Editor web part on a WSS 3.0 / SharePoint 2007 installation.  So I am going to concentrate on what is required to do so for SharePoint 2010.

First navigate to the list you wish to make the change to,  in my case I am using an issues list. In the ribbon choose List and then click on ‘Form Web Parts’.

List Ribbon

Click on the little down arrow and three options will be displayed.

Form Web Parts on Ribbon

We are interested in modifying the Default Display Form and Default Edit Form. There is no point in editing the Default New Form as the ID won’t be available yet to display.

Click on the Default Display Form, the screen will refresh to show the form in edit mode and display the web part zone.

Web Part Zone

Click on the ‘Add a Web Part’. The Web Part gallery will be displayed, select ‘Media and Content’ in the Categories and then the ‘Content Editor’. Click on Add to add it into the web part zone.

Add Content Editor Web Part

Click on the ‘Click here to add new content link’ inside the Content Editor Web Part.

Content Editor : Click here to add new content

Select the Edit HTML Source from the HTML menu.

Edit HTML Source

In the dialog, paste in the code from the PathToSharePoint site into the HTML Source and click on OK.

HTML Source with code

Choose to Stop Editing the Page and then navigate back to an issue and choose to view it, causing the newly updated display form to be used.

New Issue with Issue Id

You’ll notice a new item has appeared on the top line showing the Issue Id.  Now all that’s needed is to repeat the above for the Default Edit Form and your finished. Of course, this will only customise the list of the site you are in. If you want this to be carried through all of your sites, make sure you make the same changes to your Project template site.

About these ads

One thought on “Showing the Risk or Issue Id’s in the workspace edit and display forms

  1. Of course having a generic function inline content editor is an ideal way of showing the ID, but also utilising the views within SharePoint Design to include those fields on the create/edit and view pages as well streamlines the process rather than having inline code, this code not only can leverage an ID but also multiple values off the querystring of the particular list item.

    Alternatively you could create a custom dataview webpart bound to the list source and assign the appropriate fields that are missing from the current view.

    So many ways….

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s