Skip to main content
Face Icon

Ben the SharePoint Hobbyist Blog

Go Search
  

Other Blogs
There are no items in this list.
Team Web Site > Public > Ben the SharePoint Hobbyist Blog > Posts > Update: Display “Append Changes to Existing Text” Fields in a Custom List Form Web Part
Update: Display “Append Changes to Existing Text” Fields in a Custom List Form Web Part

I want to thank Brian Hunsaker for pointing this out to me. I've posted several times about the difficulties I've had in the past with displaying text fields in custom web parts where the "Append Changes to Existing Text" option is turned on. An example of this is the comments field in the test issues list:

I still don't know how to get this to show up in a custom Data View Web Part, but at least, with Brian's help, I've found a line of code that will allow you to display comments with a custom list form. Here's how you add a custom list form and display the comments field within SharePoint Designer 2007. I created a blank Web Part Page as my starting point.

  1. After selecting the correct web part zone, go to Insert > SharePoint Controls > Custom List Form:

     

  2. For this example, I'm going to use the following options:

     

  3. Find the line of code that references your Comments field (the text field with "Append Changes to Existing Text" turned on). If you're viewing your site in split mode, all you have to do is click on the comments field in the design area of your site.

     

  4. Replace the line that begins <xsl:value-of … and replace it with the following line of code:

    <SharePoint:AppendOnlyHistory runat="server" FieldName="V3Comments" ControlMode="Display"/>

    FieldName is the name of your field and ControlMode is the type of mode you're using to display the data (so if your form is in edit mode, you may want to use "Edit.").

Now you will see this history of this field with user and date/time stamped!

Here's a link to an MSDN article that explains some of this (although I had trouble understanding it):

 

Comments

Solution for Dataview

Hi.
I have with a lot of help from your solution also found out how to do this in a dataview:
1. Insert a dataview on a page including your multiline field.
2. Switch to codeview and find the line that reference the field.
(like: <xsl:value of....
3. Replace with:
<SharePoint:AppendOnlyHistory runat="server" FieldName="V3Comments" ControlMode="Display" ItemId="{@ID}"/>

So the magic was adding ItemID="{@ID}"/>

Regards:
Henrik Jacobsson
SYSteam Evolution
henrik.jacobsson@systeam.se
at 9/26/2007 4:48 AM

Love it when it works!

Thanks for the post, took me 3 minutes to google and fix this issue. Thanks a lot!
at 10/17/2007 12:25 PM

Nice!!

thaks for the fix!!!
at 11/27/2007 12:53 PM

Export to Spreadsheet

This worked great, but now how can you export this data to excel using the export to spread sheet feature?  ID is the only field I get.
at 11/28/2007 4:43 PM

Re: Export to Spreadsheet

That's a great question, and I'm afraid I haven't got the answer.  To be honest, I don't even know where SharePoint stores these fields when you have versioning turned on.  The truth is, when you turn on "Append Changes to Existing Text," it's actually showing you the past versions of that particular field (I think).  The trick would be to find out where those past versions are stored and how it's related to the actual item.  Then you might be able to import both tables into Access and join them as a way to get the data.

Seriously, though, all of this is just guessing at this point on my point.  If you find out, I'm eager to know!
Michael Metzcus at 11/28/2007 4:55 PM