Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

Creating a Workflow-Based Application in SharePoint Designer 2010

- How To Install Windows Server 2012 On VirtualBox
- How To Bypass Torrent Connection Blocking By Your ISP
- How To Install Actual Facebook App On Kindle Fire
3/22/2011 3:27:11 PM
The following instructions describe the process of creating a workflow that interacts with multiple SharePoint lists when items are created and modified. The workflow is based on three lists: a Region list, a Sales Lead list, and a Customer list. When a user marks a sales lead as SaleClosed, a manager can trigger the workflow and create a customer based upon the data in the Sales Lead list. This workflow also demonstrates how to work with SharePoint lookup columns by copying the salesperson from the Region list and adding the value to the customer list.

Although limited, this example demonstrates the steps necessary to develop a relatively simple application using SharePoint Designer. The functionality is limited because the processes are asynchronous, and the lists can only be joined by a single column, but the general concept could be reused for a variety of business purposes. Generally, a quickly developed application built in SharePoint is an easier sell to business owners than a standalone .NET application that requires everything from an IIS site, security, documentation, and even its own database. Furthermore, the following example can be extended with list item security, custom views, custom forms, and email notifications to make the application more fully featured.

Follow these steps to create the application using SharePoint Designer 2010:

1.
In a nonproduction site collection, create three SharePoint lists with a Standard View (Do not use Datasheet View) using the Custom List template with the columns and data types, as shown in Tables 1, 2, and 3. Unless specified in these tables, leave the other settings for the columns and the list on their defaults. Table 1 provides the columns needed for the Region list, Table 2 provides the columns needed for the Sales Leads list, and Table 3 provides the columns needed for the Customer list. Several of the columns are specified as Required to maintain data integrity within the application; if fields are allowed to be left blank, the application may not function properly.

Table 1. Region List Columns and Settings
ColumnData TypeRequire That This Column Contains Information
TitleSingle Line of Text (Already Present)Yes
SalespersonPerson or GroupYes



Table 2. Sales Leads List Columns and Settings
ColumnData TypeRequire That This Column Contains Information
TitleSingle Line of Text (Already Present)Yes
RegionLookup Column—Link to Region List’s Title ColumnYes
SaleClosedYes/No with Default Value set to NoNo

Table 3. Customer List Columns and Settings
ColumnData TypeRequire That This Column Contains Information
TitleSingle Line of Text (Already Present)Yes
RegionLookup Column—Link to Region List’s Title columnYes
SalespersonPersonNo
Customer IDSingle Line of TextNo

Note

Leave the lists blank at this point. They will be populated after the workflow is created and full instructions are provided.

2.
Browse to the home page of the site housing these lists, and from the IE File menu, click Edit with Microsoft SharePoint Designer. If this option doesn’t exist, open SharePoint Designer manually, and then select Open Site and enter the URL for the site that houses these lists (such as http://abcsp1004/sites/spdtest). Provide credentials if asked.

3.
Next, select the Workflows entry from the Navigation pane, Site Objects section on the left side of SharePoint Designer, and then select the drop-down menu under List Workflow in the Workflows tab that should be active. Click Sales Leads list, as shown in Figure 1.

Figure 1. Creating a workflow for the Sales Leads list.

4.
Name the workflow Sales Leads–On Change. Click OK.

Tip

When creating a workflow, it is good practice to provide a name that identifies the underlying list and if the workflow is triggered On Change, Manually, or On Create.

5.
Upon creation of a new workflow, the workflow editor screen appears with a blank canvas containing a single step named Step 1. Click within the Step 1 editor box in the section under the title bar to ensure it is active, and then click the Condition button on the Workflow Ribbon and choose the Condition If Current Item Field Equals Value. Step 1 will now reflect this change and display If Field Equals Value.

6.
Click the field link that now appears in Step 1, and select SaleClosed from the drop-down list.

7.
Then click the value link, and select Yes from the drop-down list. Figure 2 shows the contents of the step at this point.

Figure 2. Creating a workflow condition.

8.
Next add an action just below the condition created. Click in the Step 1 box below the row where the Condition was just defined. Type Create and press Enter, and choose Create List Item from the options.

9.
Click the This List link that will now be visible to open the Create New List Item window.

10.
Choose Customer from the drop-down menu List field at the top of the window. Figure 3 shows the results.

Figure 3. Create a New List Item window.


11.
In the Create New List Item window, double-click the field Title to open the Value Assignment window.

12.
In the Value Assignment window that opens, click the fx button and the Lookup for Single Line of Text window opens.

13.
In the Lookup for Single Line of Text window, select Title in the Field from Source field, as shown in Figure 4.

Figure 4. Complete the Lookup for Single Line of Text window.

14.
Next, click OK to close the Lookup for Single Line of Text window, and click OK to close the Value Assignment window. The Create New List Item window should be active. The Title (*) entry in the Field column now has a Value entry of Current Item:Title.

15.
In the Create New List Item window double-click the field Region to open the Value Assignment window.

16.
In the Value Assignment window, click the fx button to open the Lookup for Integer window. Verify that the Data Source field has Current Item in it.

17.
Change the value for the Field from Source to Region.

18.
Choose Lookup Id (as Integer) for the Return Field As field. The completed Lookup for Integer window looks like Figure 5.

Figure 5. Lookup for Integer window.

19.
Click OK in the Lookup for Integer window and again in the Value Assignment window to return to the Create New List Item window. Now the Create New List Item window has a value assigned to the Region (*) field of Current Item:Region.

20.
In the Create New List Item window, click the Add button to open the Value Assignment window.

21.
In the Value Assignment window, specify Salesperson for the Set This Field drop-down list.

22.
Click the fx button to open the Lookup for Person or Group window.

23.
Change the value in the Data Source field to Region and additional fields appear.

24.
In the Field from Source field, select Salesperson from the drop-down menu.

25.
In the Return Field As drop-down menu, verify that As String is selected.

26.
In the Find the List Item section of the Lookup for Person or Group window, select Title in the Field drop-down list, as shown in Figure 6.

Figure 6. Partial lookup for Person or Group window configuration.

27.
To complete the Lookup for Integer window, click the fx button for the Value field to open the Lookup for Single Line of Text window.

28.
In the Data Source field, leave Current Item selected.

29.
In the Field from Source field, choose Region from the drop-down menu.

30.
In the Return Field As drop-down, choose Lookup Value (as Text) from the drop-down menu. Click OK.

31.
The Lookup for Person or Group window will now be complete and look like Figure 7.

Figure 7. Completed Lookup for Person or Group window configuration.

32.
Click OK to close the Lookup for Person or Group window, and click Yes when the message The Lookup You Defined Is Not Guaranteed to Return a Single Value appears. Click OK to close the Value Assignment window.

33.
The Create New List Item window should now look like Figure 8 and include a Salesperson field with a value of Region:Salesperson.

Figure 8. Completed Create New List Item window.

34.
Click OK to close the Create New List Item window.

35.
Save the workflow by clicking the Save button on the Workflow tab of the SharePoint Designer Ribbon.

Note

Unlike SharePoint 2007 workflows that were immediately active upon save, SharePoint 2010 workflows are only available for use after they are published.

To publish the SharePoint Designer workflow designed so far, follow these steps:

36.
Click the Workflow Settings tool on the Ribbon, and the display changes to show the workflow settings.

37.
Verify that Allow This Workflow to Be Manually Started is selected from the Start Options section in the lower-right side.

Note

The workflow can be configured to start automatically, but the logic in this example is that the list item may be changed many times, and a user might accidentally set the item to Closed; a manager should be the only one starting the workflow, after the manager has confirmed that the lead is closed.

38.
Click the Publish button on the Workflow tab on the Ribbon to deploy and activate the workflow on the list.

Tip

A form will be visible on the Workflow Settings page that should be titled “Sales Leads – On Change.xsn.” Clicking this link opens InfoPath 2010 if installed on the computer and enables customization of the initiation form.

Testing the Workflow

Immediately after saving and publishing the workflow it’s ready for testing. To test the Sales Lead workflow, follow these steps to populate the necessary lists and start a workflow:

1.
Return to the SharePoint site where the workflow was published and the three custom lists are present. (In this example, the site is http://abcsp1004/sites/spdtest.)

2.
Access the Region list and add two items. The first item should be titled Region A and have a salesperson assigned who is a valid AD user account (such as User1 in this example). The second item should be titled Region B and have a different salesperson (such as User2 in this example).

3.
Next, access the Sales Leads list on the SharePoint site. Click Add New Item; fill in the title with Customer ABC and select Region A. Click Save. This simulates the process of a field being created for a sales prospect in a specific region. In a production situation, additional fields could be added to track conversations with the client or upload proposals and other documents to the list item.

4.
Next, edit the Sales Lead item created in the previous step, and check the SaleClosed check box; then click Save. This simulates the event where the sale is closed and the lead is ready to be converted to a customer.

5.
Next, access the drop-down menu for the item, and click Workflows.

6.
The Sales Leads – On Change workflow should appear next to the workflow icon and should display as shown in Figure 9. Click the link next to the workflow icon to access the initiation page.

Figure 9. Initiating the workflow from the Sales Leads list item.

7.
The IniWrkflIP.aspx page loads. Click the Start button.

8.
You return to the Sales Leads list and a column appears titled Sales Leads – On Change, which indicates that the workflow is In Process and then Completed.

9.
Navigate to the customer list and verify that a new item has been created, as shown in Figure 10.

Figure 10. New item created in the customer list as a result of the workflow.

10.
Return to the Sales Leads list, and click the value that appears in the workflow column to view the workflow history for that particular list item. The workflow history window opens and displays the status for the latest instance of the workflow.

Extending the Capabilities of the Application

Although the previous workflow will function properly, it is just a starting point and would not generally be considered to be “enterprise ready.” Following are some items to consider as ways of enhancing the functionality of the application:

  • Create custom list views to show and hide the sales leads depending on whether the lead is actually closed.

  • Create an alert in the Sales Leads list that alerts a manager when an item that is set to SaleClosed equals Yes.

  • Create a new workflow that starts when an item is added to the Customer list that sends an email to the assigned salesperson to alert her that she has a new client.

  • For testing purposes, add the workflow action Log to History List to output debug or informational messages to the workflow history screen.

  • Logically, the application has flaws because if a sales lead were reopened and then marked as Closed again, the workflow would trigger and create a duplicate customer; therefore, a condition should be added to step 1 that checks for the existence of the customer through the use of a lookup on the customer’s title column.

Other -----------------
- Windows Server 2003 : Authorizing Remote Access Connections (part 3) - Configuring Access Beyond the Remote Access Server
- Windows Server 2003 : Authorizing Remote Access Connections (part 2) - Understanding Remote Access Policies
- Windows Server 2003 : Authorizing Remote Access Connections (part 1) - Configuring Dial-In Properties of the User Account
- Windows Server 2008 R2 : Understanding Remote Desktop Services (part 5) - Single Sign-On & Remote Desktop Connection Display
- Windows Server 2008 R2 : Understanding Remote Desktop Services (part 4)
- Windows Server 2008 R2 : Understanding Remote Desktop Services (part 3) - RD Connection Broker & RD Licensing
- Windows Server 2008 R2 : Understanding Remote Desktop Services (part 2) - RD Gateway & RD Web Access
- Windows Server 2008 R2 : Understanding Remote Desktop Services (part 1) - RD Session Host & RD Virtualization Host
- Windows Server 2008 R2 : How Remote Desktop Works
- Installing Microsoft SharePoint Server 2010 and Configuring PerformancePoint Services : Installing SharePoint (part 2) - Running the Server Farm Installation for SharePoint
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 windows Phone 7 windows Phone 8
programming4us programming4us
 
programming4us
Natural Miscarriage
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Game Trailer