Pages

Tuesday, January 26, 2010

How to get current status of workflow from SharePoint object model

Reference Link:

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.workflow.spworkflowstatus.aspx

Sample Code:
//Obtain a list item
SPWeb thisWeb = SPControl.GetContextWeb(Context);
SPList issuesList = thisWeb.Lists["Customer Issues"];
SPListItem myItem = issuesList.Items[0];
//Get the workflow status value
int WorkflowStatusValue = myItem["MyWorkflow"];
string WorkflowStatusString = System.Enum.GetName
        (typeof(SPWorkflowStatus), WorkflowStatusValue);
StatusLabel.Text = "The current status of the workflow is: " +
        WorkflowStatusString;

1 comment:

  1. They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety. See the link below for more info.


    #obtain
    www.ufgop.org

    ReplyDelete