Custom Edit Form: Show Version History for “Append Changes to Existing Text fields”
When you create a Custom Edit form using SharePoint designer, you lose the ability to view the version history for fields with the versioning enabled (lets say, ‘Comment’ field). To show this, do the following:
Insert the ‘Comment’ field again as a form field and change the code as below in the ‘Code’ view.
<SharePoint:FormField runat="server" controlmode="Edit" . . ./>
to
<SharePoint:AppendOnlyHistory runat="server" controlmode="Display" . . ./>
Now your comments history would start showing as in the standard form!
Technorati Tags: SharePoint Designer,SharePoint Customization
When I install the code as you have described above, it gives me a Data Source Conflict. It looks like it is trying to save both inputs. Do I need to change anything else on the line of code? perhaps in the databind portion?
Make sure the id of the new field is different and you did not copy the field.
Thanks for great tip… and what about custom DispForm.aspx? Is there some way how to display old versions text too?
Thanks in advance. #JK
For DispForm.aspx, I did not have any problem. The same technique should work there also I think.
Ref: Custom Display Form
The above code displays the history, but at the same time; exposes the List Item history for the users to play with i.e date-time stamp is a hyperlink to the history item !!
Any idea, how to remove the hyperlink and make the date-time stamp simple text with no hyperlinks.
@admin
Ref: Custom Display Form
The above code displays the history, but at the same time; exposes the List Item history for the users to play with i.e date-time stamp is a hyperlink to the history item !!
Any idea, how to remove the hyperlink and make the date-time stamp simple text with no hyperlinks.
The field is an inbuilt sharepoint field. Will have to check how to manipulate it.
How should I use this method for displaying history information of fields on custom DispForm.aspx?
I expected, that there will be the same , and tags like in custom EditForm, but there is only!
I tried add, combine and replace this xsl tag with those from EditForm, but unsuccessfully
Any ideas?
Thanks. #JK
Oups… comments form deleted written tags, so again:
How should I use this method for displaying history information of fields on custom DispForm.aspx?
I expected, that there will be the same SharePoint:FormField , SharePoint:FieldDescription and SharePoint:AppendOnlyHistory tags like in custom EditForm, but there is xsl:value-of select=”@MyField” only!
I tried add, combine and replace this xsl tag with those from EditForm, but unsuccessfully
Any ideas?
Thanks. #JK
Thanks! This was exactly what I was looking for for my DispForm.
I tried the above and it seems to work on the display form but when I add it to the Edit form I am no longer able to save updates to the field. You can edit the field but it doesn’t save the changes. Any idea what I’m doing wrong?
Thanks, Steve
I am using it for editing and it is getting saved properly. What type of field are you using?
Hi, I’m having the same problem as Steve Thomas. When I add the list form field twice (changing the second one) no edits in the comments box are saved. If I remove the second one (now showing history) the edits are once again saved.
I have got it to work. I removed all the rest of the text after and left it as it shows there. This now works ok.
Thanks a lot for this, it has been a great help for me!
Hi Carl. Sorry to be a pain, but can you expand on exactly what you did and with which line of code?
I’ve got exactly the same issue and (apologies if I’m being dense) can’t work out what you did from your description.
AWESOME…THANKS!!!!
i think there is some think more than this ? the situation is important but we need some more additional informations too? am i correct ?
I tried the above and it seems to work on the display form but when I add it to the Edit form I am no longer able to edit the field. I can view the history on it but cannot update it. What am I doing wrong? Any help will be greatly appreciated.
Thanks for this – I also had the not saving problem but changed the whole code to
Am having the saving problem, and (like Mark) am not following what people have done to the code to get around this issue. Carl or Alun, could either of you describe more on what you did to fix this problem?
This is the code that worked for me:
Hope that helps.
oops, code isn’t showing lol
I used the code that Jai posted but also kept FieldName=”Comments” then the end tag
Excellent guys, with your help i managed to get both edit and display working in Sharepoint Designer 2010
For clarification so that it’s all in one place:
Do the edit first.
Firstly you need to copy and immediately reinsert the code representing the field you want to see history on and then change FormField to AppendOnlyHistory and the control mode from edit to display. AND in Sharepoint designer 2010 you also need to change the id [i added an h for history] – remember to change it all places in the code.
Original:
Inserted Code:
Save and Test
Then the display Form:
Copy the inserted code from the edit form and strip out everything apart from what is shown below:
and place it where you want the history to appear.
That’s what i did and it is all working fine. hope it works for you. Good Luck!