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!
Post a Comment