How To Create a SharePoint Workflow History Event - SharePoint Buzz - Your SharePoint Community Resource

SharePoint Buzz on Twitter

    sptechcon 2010


    How To Create a SharePoint Workflow History Event 

    The SharePoint Workflow History maintains a record of each step within a workflow.  Everything from approval activity (approve, denial), updates to a workflow, comments and even workflow errors. Workflow history list is created / deployed when you create or consume an out-of-box workflow or custom workflow. the workflow history list is not viewable in a site's All Site Content list but you can access it via the document library's workflow settings.   NOTE:  Even if a document library associated to a workflow is deleted, the workflow history remains in the site's designated workflow history list for 60 days (more on that in another article). Here's a quick sample function you can use within your custom Visual Studio workflow projects to add some comments to the workflow history list.   During debugging on the development server, you can use this function to add debugging comments to the workflow history list or once in production this function can be used to add comments that will help approvers and auditors. public void CreateWorkflowHistoryEntry(string Outcome, string Description, string OtherData) { SPWorkflow.CreateHistoryEvent(workflowProperties.Web, workflowProperties.WorkflowId, (int)SPWorkflowHistoryEventType.WorkflowComment, this.workflowProperties.OriginatorUser, new TimeSpan(1), Outcome, Description, OtherData); }

    Additional Resources:

     
    Posted on 21-Jan-09 by Kanwal Khipple
    0 Comments  |  Trackback Url  |  Link to this post | Bookmark this post with:        
    Tags: Workflow, How To, Microsoft Office SharePoint Server 2007, Microsoft Windows SharePoint Services 3.0, Developer
     

    Links to this post

    Comments

    Name:
    URL:
    Email:
    Comments: