I'm trying to create a sequential workflow but it says it needs a history list.
How do I go about manually creating such a list. I don't see any in the site templates ?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityI'm trying to create a sequential workflow but it says it needs a history list.
How do I go about manually creating such a list. I don't see any in the site templates ?
Workflow History is automatically created in the site when a workflow is associated to a list (I think), but it is always hidden.
Workflow uses list of TemplateType 140 - WorkflowHistoryList.
When adding workflow from user interface, Sharepoint suggests you to create this list automatically.
If U want to add it programatically, U can use feature receiver with following code:
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
var web = (SPWeb)properties.Feature.Parent;
_uniqueId = web.Lists.Add("WorkflowLog", string.Empty, SPListTemplateType.WorkflowHistory);
_list = web.Lists.GetList(_uniqueId, false);
_list.Hidden = true;
_list.Update();
_uniqueId = web.Lists.Add("WorkflowTasks", string.Empty, SPListTemplateType.Tasks);
_list = web.Lists.GetList(_uniqueId, false);
_list.Hidden = true;
_list.Update();
}