Business requirement: Show ID field on the DispForm.aspx page
The ID field of a SharePoint list is not shown by default on the DispForm.aspx form page. This can be very annoying, especially in cases where an Issue Tracking list is used: most of the time business users want to see the ID for an Issue Tracking list item.
Solution: Create a shadow ID field
- Create a site column CopyID (Number, Number of decimal places: 0)
- Add the CopyID column to the site content type Issue.
- Create an Issue Tracking list.
- Open the site in which the Issue Tracking list is created with Microsoft Office SharePoint Designer.
- Start creating a new Workflow (File > New > Workflow) attached to the Issue Tracking list. Let the Workflow start automatically when a new Issue Tracking list item is created.
- Assign the value of the ID field to the CopyID field.
- Use the tool SharePoint Tips Utility Pack to change the rendering of the CopyId field on the form pages (for more information, see Hide list fields upon creation of a SharePoint list item): Show the CopyId field in the Display Form, but not in the New nor Edit Forms. Change the Field Name to ID.
Upon creation or editing a Issue Tracking list item, the ID field is not shown:
Upon displaying a Issue Tracking list item, the ID field is shown. In fact this ID field, is the previously named CopyId field, which receives the value automatically from the system ID field upon creation of a new Issue Tracking List item thanks to the previously created Workflow. We need to work with a shadow ID field, as it seems not possible to render the system ID field on the DispForm.aspx page, even not with the SharePoint Tips Utility Pack: it seems as if the properties to render it on a DispForm.aspx page don't work for the system ID field. That is why I've chosen here to use a shadow field.
Why would you not just create a site column called "Issue ID" and make it a calculated value "=ID", and not display it on any views. Since its calculated, it will not show on new or edit pages, but will show on item details.
Answered that question...it zeros out the field on edit...
There HAS to be a better way to do this, I have numerous lists, and it used to show this in 2.0.
Maybe some scripting to pull it out of the URL.
Hi Josh,
feel free to share it here if you find a better way: I am looking forward to it.
Well I am working on another way, but it is only slightly less laborious. By creating a custom list webpart and hiding the default webpart, it would appear you can throw the ID in there. But that still means editing EVERY list, which just isnt feasible.
I'm going to dig, I am pretty sure somewhere I came across a way to populate a field from the URL, and since the URL contains the record number, you should be able to pull that down.
At least that would only require a content editor webpart on each list referencing some saved code.
We shall see...hopefully I'll get something. This is just an issue that will always be present in my environment on every list, and coming from WSS 2.0 where it was there, the users want it back!
This post have really neat solution. It uses the URL to grab the id and place it in the page. really cool.
http://pathtosharepoint.wordpress.com/2009/01/18/item-id-in-display-and-edit-forms/
HTH,
Nilesh Vasave
I created a new calculated field and set it to the value "=ID" and display that on the form and it works well.
@Anonymous - the calculated field trick was also my first idea, but is stopped working after a few days (!).
The workflow way is less destructive than editing the display form, and what I end up doing too.
Does anyone have any advice on how to add the field descriptions that show in the Edit and New Forms, to the Display form?
Some of the field names I have in a list are quite short, and really require the descriptions:
href="http://www.amphibianark.org/Image2.jpg"
The display form, which most visitors to the site see, could really do with these descriptions:
href="http://www.amphibianark.org/Image1.jpg"
Any help would be very much appreciated.
Kevin
kevinj@amphibianark.org
Hi,
I have an existing list to which I wanted to add this. (display the Issue ID when user view it in Edit or Display more). I tried to follow your steps. Created the site column and added the column to the site content type of Issue. However, when I create the workflow in designer, I am not able to see the CopyID column I created (Step 6 in your article). Any idea why it is so?
Post a Comment