Tuesday, May 11, 2010

How to change SharePoint Workflow status to a custom value

Step 1 - Add following to workflow.xml file

<ExtendedStatusColumnValues>

<StatusColumnValue>Need Restart</StatusColumnValue>                

<StatusColumnValue>Waiting for Approval</StatusColumnValue>

</ExtendedStatusColumnValues>

Step 2 - Use SharePoint Workflow SetState shape.

Bind a field workflowState to its State Property.

MethodInvoking - setWorkflowStatus_MethodInvoking

private void setWorkflowStatus_MethodInvoking(object sender, EventArgs e)

{

//// SPWorkflowStatus.Max for "Need Restart"

//// SPWorkflowStatus.Max + 1 for "Waiting for Approval"

this.workflowState = (int)SPWorkflowStatus.Max;

}

Step 3 - For an existing feature, deactivate - uninstall - install - Activate the feature for the above changes to reflect.

2 comments:

  1. Insightful post. We teach Dell Boomi using practical workflows and industry examples.dell boomi full course

    ReplyDelete
  2. Python Django online classes deliver structured lessons with guided coding practice.It strengthens fundamentals.This python django online classes support professional learning.It is dependable.

    ReplyDelete