BrightWork Tip: Call a Workflow with a Custom Action
SharePoint Designer 2010 makes it really easy to call a workflow from a custom action. A custom action is a UI option that you can add to the ribbon or to the list time menu. In this post I will show how to add a custom action to the list item menu that calls a workflow that marks an item as complete.
First we have to create the workflow and then we create a custom action and bind it to the workflow. We will be using a pmPoint Project Issues list for this.
Create the Workflow
- Navigate to your SharePoint 2010 site and click Site Actions | Edit in SharePoint Designer.
- Click Lists and Libraries and then click the list that you want to add the workflow to.
- Click List Workflow.
- Give the Workflow a title and click OK.
- Click Action | Set Field in Current Item.
- Set the % Complete to 1
- Set the Actual Finish Date to Today and the Status to (3) Completed.
- Click Publish.
Add Custom Action
- Return to the SharePoint Designer page for the list and click Custom Action | List Item Menu.
- Give the Item an appropriate name (NB: this is the text that will appear in the list item menu).
- Select Initiate Workflow and select the workflow you just created.
- Click OK.
Now, users will have the option of marking an item in the list as complete.