- Name: CreateOrEdit
- Attachment List: Price List
- Start Options: Automatically start this workflow when a new item is created and Automatically start this workflow whenever an item is changed
Monday, November 3, 2008
SPD Workflow: Was the workflow started due to a Create or an Edit action?
A. Introduction
When creating a workflow using Office SharePoint Designer, you might choose to start the workflow when a new item is created OR whenever an item is changed. Consider the case that the actions performed in both situations are the same except for one step which should differ based on whether the processed item is a new one or just an updated one.
A simple straight-forward solution is to create two workflows that differ only by one step. I don't need to elaborate on how inconvenient this approach is: (1) during the development phase (2) whenever you need to maintain the workflows.
As the title conveys, in this article I would like to show how one can use the Conditions section to determine whether the workflow was triggered due to an item's change or a new item's creation. This way, you would need only one workflow which would branch whenever needed and merge back.
B. Preparations
Create the list, which we would attach the workflow to. For this demo, I have created a custom list called Price List.
C. Workflow
- Open Microsoft Office SharePoint Designer 2007.
- Click File > Open Site.
- Enter the URL of the site containing our custom list called Price List.
- Now click File > New > Workflow.
- On the Define your new workflow page, enter the following data:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment