Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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 ?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Workflow History is automatically created in the site when a workflow is associated to a list (I think), but it is always hidden.

share|improve this answer
add comment

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();
    }
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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