.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to Add a Version History of SPlistItem ?

Posted By:      Posted Date: August 26, 2010    Points: 0   Category :SharePoint

Now , I import the splistitem data from a list to another list, but  the listitem's version history disappear, Also I can get the splistitem's Version . what should I do to add each Version History of  the   listItem ???

Can you give me some code ?

Help me ,




View Complete Post

More Related Resource Links

Version history file properties



I move files into different folders programmatically. If a file was changed and it will be move again the new file is the actual file and the old file remained in the verison history.

How I save the new version:
SPFile destfile=website.getFile(destUrl);

Normally when you upload the new file with changed properties manually you see the changed properties in the version history.
When I do this programmatically I have the new file with the main version but the changed properties would not be displayed.
Can anybody help me?

Thanks and Regards

Trying to include version history table inside Word document

Running MOSS 2007 with SP1, Office 2007.   I'm trying to create a table (doesn't have to be a table though) of a document's version history inside the document. This would be the history information kept by SharePoint. Since we can't even easily get just the current version number into the document I'm having problems and thought I'd see if anybody has a bright idea.   First, a couple facts. From Word 2007 it is possible to view the Document Library version information by clicking on the Office Button > Server > View Version History. This brings up the following: Click for screenshot   My goal is to get that version information displayed IN the document so when it is printed there is a document history. I tried using IRM label policies, but this only displays the current version and you can't include the comments.   After some digging I found the following code sample on MSDN:   Code SnippetDim dlvVersions As Office.DocumentLibraryVersions    Dim dlvVersion As Office.DocumentLibraryVersion    Dim strVersionInfo As String    Set dlvVersions = ActiveDocument.DocumentLibraryVersions    If dlvVersions.IsVersioningEnabled Then        strVersionInfo = "This document has " & dlvVersions.Count & " versions: " & vbCrLf        For Each dlvVersion In dlvVersions            strVersionInfo = strVersionInfo & _                " - Versi

page version history gives error: "value cannot be null. parameter key: name"

Hello, I'm have customized my homepage in SharePoint Designer 2010. I want to go back to a previous version, so I right click on the aspx file in sharepoint designer and choose "version history". When I do that I get this message: There was an error connecting to the server. The server error encountered is "Value cannot be null. Parameter name: key" What should I do in order to revert my aspx page to a previous version ?

can we hide 'delete all versions' from version history with the help of javascript?

hello guys, can we hide 'delete all versions' or tool bar from version history. Can we write some JavaScript to do that?  Thanks

Version History for NewForm.aspx


Hi All,

I urgently need to switch back to one of the previous versions of the customized Newform.aspx  form . I dont see any option when i right click on the form but in the properties i see the version as v2.0

any help is appreciated.


Isha kapoor My SharePoint Blog Follow me

Display Version History in List View Column


I am working with a multitext line for comments and I have enabled versioning.  The version history shows in each item within the View Form.  I was wondering if I can have the comments field list in the List View as a column with all the version history.  Right now, it shows as a link "View Entries...".  I would like to be able to view all versioin history in the list view under the comments column.

Is is there a feasible solution?

Thanks in advance.


Auto-fill fields are racking up the version history whether they are on one workflow or many....SPD


I have a whole batch of fields which trigger an automatic date entry when they are changed: if more than one field is changed then a version is created for each field that is changed. I did some more fiddling to see how many of these workflows I could cram into one (originally built to have one workflow per date trigger) and tested again but although the changes are grouped together now the system automatic updates still trigger another version for each automatically entered date. Anyone know how to get around that? Its not unbearable but it just offends me somehow and it might cause a problem later on.

Search the Version history


Seems to me it is not possible out of the box, but is there a way to make Sharepoint display searchresults from the version history of lists and document librarys?

thanks in advance

View Version History in SharePoint Designer 2010


Can SharePoint Designer view the version history of a list?  I want a workflow to send an email only when a specific column has been modified.


Moving Documents between Libraries with Version History Completely Intact




Trying to verify that I've found a what I believe is fairly large weakness in the SP API: moving documents while keeping their version history completely intact as they are.


API deals with this in very incomplete way:

- SPFile.Move() does send the versions with document, but wipes out all version's comments and sets their Modified to date of operation and ModifiedBy to user context running code.

-SPCopy has no movement of versions available


Some posts/articles in the community on this.  Solution given is to interate over the source file's versions and run SPFileCollection.Add() of the target folder for each version.  That method has 13 overloads, but none allow you to preserve all aspects of the version - very aggravating:

- One overload allows setting of Modified and ModifiedBy - but not Version comments

- One overload allows setting version comment but not Modified/ModifiedBy.

- One allows sending the version's property bag over, but this seems to have no effect on version comments or Modified/ModifedBy on the destination file.


If anyone in possession of an approach I do not see here wo

How can I show version history on a custom edit form?



I have a simple list that contains aa title and a number field.  On the edit form, I want to show all prior updates to the number field, like so:

Title:  ABC
01/01/2010     10  Updated by: user1
02/01/2010     20  Updated by: user2
Count:            <Textbox for input>

I can create a custom edit form in Designer, but by default I get a DataFormWebPart with an XSLT.  I don't know how to configure the data source to pull all versions so that they could be shown in the XSLT.  If I can't use the DFWP and have to do everything custom, please provide details and/or links.

This is for WSS 3.0.  Any help would be greatly appreciated.  Thanks!
 - Ed.

Version History: Some versions being lost (saved as 0KB)


Greetings all,

We've got lots of users having lots of fun with Document Library versioning. Great stuff, right?

Well, some users are complaining that when they check in and close, their versions are being lost - entirely!  It's hard to tell what could be the cause of this, but the version history does seem to back up the fact that *something* is going on. Here's a sample: http://img545.imageshack.us/f/versionissues.jpg/ ....

Here are the facts:

* Working from inside and outside our VPN

* Working on a range of MS Word versions

* Show a history of correctly checking in and checking out documents, so I think they're competent enough to not have saved a blank file

Ideas, anyone? What could be going on here?



How to retrieve version history/comments of Comments field?



I want to retrive "Comments" field AppendHistory in my aspx page. I read on MSDN regarding <SharePoint:AppendOnlyHistory>, but I am not sure how do I asign value in this control. However I am able to retrive "Comments" field as mentioned below, but not sure how do I display "Comments" field version history/comments

txtComments.Text = Convert.ToString(retrieveItem["Comments"]);

and my comments object tag code in aspx page is
<SharePoint:InputFormTextBox ID="txtComments" RichText="true" RichTextMode="Compatible" runat="server"
                TextMode="MultiLine" Rows="5" ></SharePoint:InputFormTextBox> 


Direct link to Version History in an email.


I have looked for a few days now, and I can find countless similar questions.  People want to email the person who made a help-desk request and present them with the history of the request.

Ideally, that would be accomplished by inserting all the changes into the email, as generated by the workflow.  However, I am a realist, and I would be happy to send the user a direct web link to the Version History of the Help-desk request in question.

I must have seen 30 similar requests on various forums around the globe in the last two days, but I am yet to see an answer.

Thank you kindly


version history in a data view


Hi. I've got a data view web part that I've customized. Is it possible to place the version history of a list in one of the columns of the table?





SharePoint Version History Reporting

I need to run a report against version history information. Specifically, show all instances where a column value was changed to 'X' on a specific date. I'm not sure how to approach this problem.
What is the DB table name?
Can the report be done inside SharePoint?
Is there a third party tool that anyone is using for history reporting?

Open to all thoughts
Many Thanks!

ASP.NET 4.0: WebForm Routing (quick n dirty version)

One of the things we're adding in ASP.NET 4.0 is built-in support for using Routing together with WebForms. Now, I'm totally aware that this is possible to do already and that a number of people have posted ways of doing this with the Web Routing feature which shipped with ASP.NET 3.5 SP1. We're just adding some features to make it easier to do
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend