Taming the Elusive “Calculated Column” – Referencing a Multiple Lines of Text Column With Append Text: Part 2
In Part 1, Dessie gave us the first six steps "How to reference a ‘Multiple Lines of Text’ column in a ‘Calculated Column’ to display a complete list of appended changes to all items on a list as a group – in 10 Easy Steps”. Now we pick up where he left off with Step 7:
Step 7: The “Magic” URL
In order to be able to view the complete list of versions in an items history, you needn’t look any further than the magic URL of “?IncludeVersions=TRUE”. Why this wasn’t made as a directly accessible option in views I’ll never know, but suffice it to say, all you need to do is add this to the end of your list view URL and watch the magic happen.
http://[Your-Domain]/Lists/All%20Comments/AllItems.aspx?IncludeVersions=TRUE

Of course, it may make more sense if you add in the “Version” column to your view:

Notice how the most recent version is the one listed first?
Step 8: My Memory is full!!
Although this approach is “technically” working, it’s not really the best tactic (as it is) since you’ll have to remember what that “Magic URL” is and paste it in each time you want to view the list of versions.
To remedy this, we’ll create a separate view and use some simple JavaScript to append on the “Magic URL” to our target page.
Start by creating a new view called “Comments View” and add in the columns “Title (linked to item with edit menu)”, “Expanded Comments”, and “Version”.
Additionally, scroll down to the “Group By” section and choose “Title” for the first group by column and choose “Expanded” for the default “Show Groupings” setting.
This will display as:

Next, we need to add in the “Magic URL” to our link for this view so it automatically displays the complete version list when we get there.
Choose the “All Items” view from the View dropdown to return to the default view page.
Once there, go into the CEWP, open its “Source Editor” and right before the closing “script” tag, add in the following:
var items = document.getElementsByTagName('ie:menuitem'); for(var i=0; i<items.length; i++) { if(items[i].id == "zz30_View1") { var itemAtt = items[i].attributes; var newAtt = itemAtt.onMenuClick.value; itemAtt.onMenuClick.value = newAtt.replace(/aspx/, "aspx?IncludeVersions=TRUE"); } }
Note – the above referenced “ID” of “zz30_View1” is what I’ve noticed to be the default id given to the first custom view created (the “All Items” view always seems to get “zz29_View1”). I just wanted to mention that here in case it doesn’t work for you, you may need to view the page source to find the appropriate ID.
Once saved, clicking on the “Comments View” from the view dropdown will now take you to the view, but also have the “Magic URL” appended to it which will expand out the list of comments for viewing:

Step 9: Test Round 2
Once we have this set up, go back to the list and create several new items – each with several edits to make a history of comments.

Till next time…
– Dessie
In his next post, Dessie gets us to step 10 and cleans everything up.
Dessie Lunsford
Points-of-Sharing
- Taming the Elusive "Calculated Column"
- EndUserSharePoint.com: Taming the Elusive "Calculated Column" - Customizing a Task List
- EndUserSharePoint.com: Taming the Elusive “Calculated Column” - Customizing a Task List (Part II)
- EndUserSharePoint.com: Taming the Elusive “Calculated Column” - Customizing a Task List (Part III)
- EndUserSharePoint.com: Taming the Elusive “Calculated Column” - Customizing a Task List (Part IV)
- EndUserSharePoint.com: Taming the Elusive “Calculated Column” - Text and Data
- EndUserSharePoint.com: Taming the Elusive "Calculated Column" - Customizing a Contacts List (Part I)
- EndUserSharePoint.com: Taming the Elusive "Calculated Column" - Customizing a Contacts List (Part II-I)
- EndUserSharePoint.com: Taming the Elusive “Calculated Column” - Customizing a Contacts List (Part II-II)
- EndUserSharePoint.com: Taming the Elusive “Calculated Column” - Customizing a Contacts List (Part II-III)
- EndUserSharePoint.com: Taming the Elusive “Calculated Column” – Text and Data (Part III)
- EndUserSharePoint.com: Taming the Elusive “Calculated Column” – Text and Data (Part IV)
- EndUserSharePoint.com: Taming the Elusive “Calculated Column” – Text and Data (Part V)
- EndUserSharePoint.com: Taming the Elusive “Calculated Column” – Text and Data (Part VI)
- Taming the Elusive “Calculated Column” – Lookup and Reference
- Taming the Elusive “Calculated Column” - Logic
- Taming the Elusive “Calculated Column” - Logic - Part 1
- Taming the Elusive “Calculated Column” - Logic - Part 2
- Taming the Elusive “Calculated Column” - Logic - Part 3
- Taming the Elusive “Calculated Column” - Logic - Part 4
- Taming the Elusive “Calculated Column” - Logic - Part 5
- Taming the Elusive “Calculated Column” - Logic - Part 7
- Taming the Elusive “Calculated Column” - Logic - Part 6
- Taming the Elusive “Calculated Column” - Logic - Part 8
- Taming the Elusive “Calculated Column” - Logic - Part 9
- Taming the Elusive “Calculated Column” - Logic - Part 10
- Taming the Elusive “Calculated Column” - Date and Time - Part 1
- Taming the Elusive “Calculated Column” - Date and Time - Part 2
- Taming the Elusive “Calculated Column” - Date and Time - Part 3
- Taming the Elusive “Calculated Column” - Date and Time - Part 4
- Taming the Elusive “Calculated Column” - Referencing Multiple Lines of Text Column
- Taming the Elusive “Calculated Column” – Date and Time – Part 5
- Taming the Elusive “Calculated Column” – Date and Time – Part 6
- Taming the Elusive “Calculated Column” – Date and Time – Part 7
- Taming the Elusive "Calculated Column" - Referencing a Multiple Lines of Text Column With Append Text: Part 1
- Taming the Elusive "Calculated Column" - Referencing a Multiple Lines of Text Column With Append Text: Part 2
- Taming the Elusive "Calculated Column" - Referencing a Multiple Lines of Text Column With Append Text: Part 3
Is this code incomplete in STEP 8:?
var items = document.getElementsByTagName(’ie:menuitem’);
for(var i=0; i
Hmm…the formatting seems to have been broken when Mark rebuilt things. I’ll ping him to get it fixed.
Meanwhile,
Here’s the script:
- Dessie
Should be working now…
Thanks Dessie,
Please include Sort by Version/Desc while creating custom Comments View in step 8 to complete.
Somehow the script you have provided not working, So I have modified as shown below:
But even now, there are two open issueson my list:
1) I have click twice to get all version shown in action menu. Please let me know, If I am missing anything here.
2) All Items view does show Expanded Comments as third comment
Am I missing anything here?
Thanks Dessie, Great Article series.
Ignore my previous request. Partly it is working now and your Part-3 was taking care of version sort order etc.
1) I have click twice to get all version shown in action menu. Please let me know, If I am missing anything here.
Thanks Again,
Venky
Hi Dessie,
Excellent article and worked great for SP2007.
However, we’ve switched to using SP2010 and I’ve been having trouble getting versions to display. Any idea?
Thanks,
Gil