0
votes

I'm creating a custom application to view, create and manage a SharePoint 2010 list through a Silverlight 3 application. NOTE: It is a client side application

I've managed pretty much all the basic functions, loading the items of the list, creating new items, editing them etc... but I'm stuck with one specific function.

I have a text field ("multiple lines of text" in SharePoint) which has versioning activated, so as to keep a track of who, and when, each comment was made.

My problem is that I can't find a way to access the previous entries, using:

var comments = myListItem.FieldValues["Comments"];
commentsField.Text = comments.ToString();

returns a string of the most recent entry, but not of the previous entries.

I would like to be able to access all the comments made, together with who made them and when they were made.

Could you help me or point me to the right direction?

Thanks, Kenny

1
Will get more focused answer if you post the code where you got stuck.Flowerking
I'm sorry, I don't really have any code for this, I'm just trying to retrieve the values of this field and I get the object not set to an instance of an object.Kenny

1 Answers

0
votes

Try this:

foreach (SPList list in yourList)
{
    foreach (SPListItem item in list.Items)
    {
        foreach (SPListItemVersion version in item.Versions)
        {
            SPField temp = version.Fields["Comments"];
            //use your temp 
        }
    }
}