I am developing a workflow. I have extended the Workflow Task content type with the Comments field using SharePoint UI. I need to set some value for this field in my code when editing the task, but it stays empty. Here's my code:
private void SetTaskProperties(string comment)
{
Hashtable taskProperties;
taskProperties = new Hashtable();
taskProperties.Add(SPBuiltInFieldId.Completed, true);
taskProperties.Add(SPBuiltInFieldId.TaskStatus, completed);
taskProperties.Add(SPBuiltInFieldId.PercentComplete, 1.0);
taskProperties.Add(SPBuiltInFieldId.Comments, comment);
SPWorkflowTask.AlterTask(this.task, taskProperties, false);
}
Should I be using something else than SPBuiltInFieldId.Comments? I am getting the same result when updating the task directly, instead of using the Hashtable in the code above.
SPBuiltInFieldId.Commentsand withSPBuiltInFieldId.Comment. Did you know that there are 3 fields in SharePoint that are named Comments? This is nuts! – Boris Nov 27 '12 at 15:35