General Tips for the SQL Workflow Toolbar

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

 

Richie Weldon
Microsoft Corporation

March 2001

Applies to:
   Microsoft® Office XP Developer

Summary: This article discusses several tips for making the Microsoft Office XP Developer Workflow Toolbar more effective for users. The workflow toolbar is an ActiveX control that integrates with data access pages. It displays the workflow events available to the user for each record in the workflow application. (6 printed pages)

Contents

Introduction Adding the Workflow Toolbar to Your Access Toolbox Changing the Background and Border Options Showing Only Actions Available to the User Minimizing the Number of Change Buttons Altering the Order in which Buttons Appear on the Workflow Toolbar Adding Script to Trap Workflow Toolbar Events

Introduction

This article focuses on enhancing the SQL Workflow Toolbar for Microsoft® Office XP Developer SQL Workflow Solutions. Hereafter the SQL Workflow Toolbar will be referred to as the workflow toolbar.

It is assumed that you are familiar with Microsoft SQL Server management, Microsoft Access Data Access Pages, Microsoft Visual Basic® Scripting Language (VBScript), and Microsoft FrontPage® Web sites. In addition, you must have access to computers equipped with Microsoft SQL Server 2000 and Microsoft FrontPage Server Extensions. The recommended operating system is Microsoft Windows® 2000.

Instructions are given with the following assumptions:

  • A standard SQL Workflow Solution was created using the Microsoft Office XP Development Environment.
  • You are working on a computer where Microsoft Access 2002 is installed.
  • You fully installed Microsoft Office XP Developer product.

Adding the Workflow Toolbar to Your Access Toolbox

If you create more than one data access page, you might want to add a button to the Access toolbox for the workflow toolbar. Doing so will enable you to access the workflow toolbar and place it on data access pages without having to scroll through all the available ActiveX elements.

Assuming Microsoft Access 2002 is launched, you previously created a Data Access Page and an Access Data Project, and the Data Access Page is currently in design view, the following steps illustrate how to add a button for the workflow toolbar to the Access toolbox.

Adding a button to the toolbox

  1. Right-click any area of the Access toolbox, and select Customize from the context menu.
  2. Select the Commands tab on the Customize dialog box.
  3. Scroll to the bottom of the Categories list, and select ActiveX Controls.
  4. Scroll through the Commands list, and select Microsoft Office Developer Workflow Toolbar.
  5. Drag the selected item from the Commands list onto the Access toolbox.

Now you have the option to leave the button as-is or customize it to resemble other buttons in the toolbox. Customizing the button will make it possible for you to replace the name of the ActiveX object with an icon.

Note   If you closed the Customize dialog box, you will not see the appropriate context menu when you right-click the workflow toolbar button. Reopen the dialog box by right-clicking the toolbox and selecting Customize from the context menu.

Customizing the newly added button

  1. Right-click the newly added button.
  2. Select Default Style if you want to display an icon instead of text for the button face.
  3. Select Change Button Image to change the default icon for the button face.
  4. Close the Customize window.

Changing the Background and Border Options

When the workflow toolbar is placed on a data access page, it appears flat because of the default options for both the background color and border color. Fortunately, both of these options are changeable, thus making it possible for the workflow toolbar to be better integrated with your data access page.

Changing the background color

  1. Make sure the Data Access Page is in Design view and contains the Workflow toolbar.
  2. Right-click the Workflow toolbar, and select Element Properties from the Context menu.
  3. On the Format tab, select the text entry box for BackgroundColor. When the BackgroundColor text box is selected, an ellipsis becomes available to the right of the field, making it possible to use the color-picking tool.
  4. Click the ellipsis (...) to the right of the text entry box to view the color-picking tool. Select one of the predefined colors, or create your own. Alternatively, if you are familiar with RGB values, you can enter in the hexadecimal value. Do not forget to include the pound (#) sign if you enter in an RGB value.
  5. Save your Data Access Page.

To view the changes you made to the BackgroundColor for the workflow toolbar, you should load the Data Access Page in Internet Explorer or switch to page view mode by selecting View, then Page View, from the menu bar. When you are done previewing your page, you should switch back to design view.

Changing the border options

  1. Find the BorderStyle entry on the Format tab, and enter in the type of border you want to display. The default value is none, however any of the following values are acceptable:
    • Dotted
    • Dashed
    • Solid
    • Double
    • Groove
    • Ridge
    • Inset
    • Outset
  2. Find the BorderColor entry. Here, you can either specify an RGB value or use the color-picker tool to choose the color you want. To launch the color-picker tool, click the ellipsis (...) to the right of the text box.
  3. Find the BorderWidth entry. For this item, you should choose between medium, thin, and thick. Medium is the default value. In addition, you can specify a specific value, such as 12.75 px. An acceptable value is a floating-point number followed by one of the following units: cm, mm, in, pt, pc, or px.

Showing Only Actions Available to the User

If your workflow has many transitions, a large number of buttons will appear on the workflow toolbar when the data access page is loaded in Internet Explorer. Because the workflow toolbar displays all of the buttons in a linear fashion, the user will have to scroll horizontally across the page until they find the desired action. By setting the HideUnavailableActions property to True, you can diminish the number of buttons the user is presented with at each workflow state.

Setting the HideUnavailableActions property

  1. Make sure the Data Access Page is in Design view and contains the Workflow toolbar.
  2. Select the All tab, and look for the HideUnavailableActions entry.
  3. Change the value to True.

Performing this task will display only those transitions that the user can access immediately for a particular record. The number of buttons displayed on the toolbar should decrease.

Minimizing the Number of Change Buttons

In addition to hiding unavailable actions, you also can reduce the number of buttons displayed on the workflow toolbar by renaming captions for transitions of similar actions. For example, you only need one button to make it possible for the user to edit data at each of the workflow states.

Making use of a common Edit button

Unlike the previous tasks, this task requires you to change items on your workflow.

  1. Launch the MOD Development Environment, and open the SQL workflow solution.
  2. Open your workflow process definition by double-clicking the workflow process in the Solution Explorer.
  3. Locate all the transition-within shapes on the diagram surface.
  4. Select each one individually, and change the caption value to say Edit.
  5. Make sure you save the changes to the workflow diagram. If you do not save the changes, the workflow toolbar will not show the updated changes.
  6. In Internet Explorer, refresh the Data Access Page.

Now, you should have only one Edit button. This button can be used to change values of records at any state in your workflow.

Altering the Order in which Buttons Appear on the Workflow Toolbar

Now that you have one common button to make it possible for users to edit data, you probably want to reorder the buttons, so the edit button is more logically located. Placing the Edit button near the front should make it easy for user to access.

Changing the order in which buttons are displayed

  1. Load SQL Sever Enterprise Manager.
  2. Expand the database node for your SQL Server.
  3. Expand the node for your database.
  4. Select the Tables item under the database node.
  5. Right-click the table that ends with the string WorkflowActions.
  6. In the <maintable>WorkflowActions table, locate the column for Position. In this column, you can add an integer value to specify the order for each action. The integer value with the lowest value will be displayed first, followed by the next lowest, and so on.

You can leave some buttons in their default order by leaving their position values as NULL. These buttons will appear after the ordered buttons are displayed.

Adding Script to Trap Workflow Toolbar Events

It is possible to add script to trap certain events that are fired off from the workflow toolbar. This can help you display information to the user in a message box or automatically add values to fields on a data access page. The following steps explain how to add values to a field.

Adding script to auto-populate a field

  1. Load the Data Access Page in a text editor, such as Microsoft Script Editor.

  2. Look for the script tag in the HTML source code.

  3. Just above this script tag, place the following code:

    <script language=vbscript event=ClickAction for=ActiveXCtl0>
              if ActiveXCtl0.Event.Caption = "Record Date"
                        szDescription.value = date
              end if
    </script>
    
  4. Save the script by clicking the Save button.

  5. Load the Data Access Page in Internet Explorer.

There are numerous methods and events you can call based on the object model for the workflow toolbar and the data access page. In the previous example, szDescription is a field on the data access page. If you want to set focus to this field instead of assigning it a value, type in szDescription.focus on the line that says szDescription.value = date.