简体   繁体   中英

Sharepoint 2010. Api. How to get field history?

I have SPListItem and some text field. I need in code get all versions of this field EX:

  1. version 1 "hello rorld"
  2. version 2 "hello world"
  3. version 3 "new application"

Any examples how to do that?

Try this:

foreach (SPListItemVersion version in item.Versions)
{
    Console.WriteLine(string.Format(
        "{0}. version {0} \"{1}\"", 
        version.VersionId, version["this field"]));
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM