0

I have a list with an custom append only field for collecting comments from supervisors. When I query the list using SPQuery I always get null back for the value of the append only field. I have tried explicitly requesting that field with setting

query.ViewFields

All of my other values come back fine, and I am able to view the comments via the out of the box functionality through the web ui.

1
  • Make sure you are using the internal name of the field. Show some more code...
    – BlueBird
    Jun 11, 2013 at 18:05

1 Answer 1

0

I was able to get it working by iterating through the versions of the item and when I find the first value I push it into my custom object.

        int i = 0;
        foreach (SPListItemVersion oVersion in myListItem.Versions)
        {
          String s = Convert.ToString(myListItem.Versions[i]["SiteColumn_SupervisorSummary"]);
          if (s.Trim() != String.Empty)
          {
            myObject.SupervisorSummary = s;
            break;
          }
          i++;
        }

AppendOnly fields will only work if versioning is turned on the list. The latest version of the item is available at listItem.Versions[0] however, in that version, my field was null. My assumption is that the versioning of list items saves deltas and the lastest version had some other change than the Supervisor Summary.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.