I understand that you can access comments in an append-only field like:
public string retrieveComments(SPListItem item)
{
SPListItemVersionCollection versions = item.Versions;
string latestComment = "";
try
{
foreach (SPListItemVersion itemVersion in versions)
{
if (itemVersion.IsCurrentVersion)
{
latestComment = itemVersion["Comments"].ToString().Trim();
}
}
}
catch (Exception e3)
{
//handles exception
}
return latestComment;
}
Is there any way to create a new version of the list item and append a comment as the latest comment through C#?
My goal is for someone to email the list and take the body of their email and append it as a comment.