Create discussion

Nov 23, 2007 at 7:14 PM

There is no valid method to create a discussion item through a workflow using create item and this would be great addition.

The activity could be Add Discussion <list> (output: <item>)

The below code is snippet that would have to be wrapped in an activity.


using (SPSite site = new SPSite("SITE URL"))

{

using (SPWeb web = site.OpenWeb())

{

SPList list =web.Lists"LIST TITLE";

result = SPUtility.CreateNewDiscussion(list.Items, "SUBJECT");

resultSPBuiltInFieldId.Body = "BODY";

result.Update();

}

}