Workflow Toolbar Features

See Also

The Workflow Toolbar control makes it quick and easy to create a data access page with solution support. It adds a menu bar to the user interface that makes it possible for users to pick available workflow actions. The options available are based on the workflow process defined for the team solution. The control also provides offline redirection support, so you do not have to write any script to make it possible for a team solution to work seamlessly offline. In addition, the toolbar control provides an Offline menu item on the toolbar that makes it possible for users to make a solution available offline and synchronize changes.

For more information about these three features, see the following sections:

Workflow Actions

For the toolbar to display the workflow actions on the data access page, the UniqueTable property must be set to the base table containing the workflow actions. In addition, a field bound to the workflow state column must be included on the data access page in either the first section or the section specified in the toolbar's RecordSource property. This field can be hidden.

Important   If you alter the UniqueTable property of the data access page after adding the toolbar control to the page, the control will not pick up the new setting automatically. The UniqueTable property is checked when the control loads, so you must close and re-open the designer, or switch between page and design view, before the toolbar picks up the change.

At run time, the toolbar control adds buttons for each uniquely named OnCreate, OnTransition, OnUpdate, and OnDelete action in the workflow process. Based on the value of the workflow state column in the current data row, the toolbar control enables or disables buttons to reflect the actions that are available in that state. The toolbar control only creates the buttons if the ShowActionButtons property is True. Otherwise, it does not do any workflow related processing.

By default, the toolbar control expects users to select an action, perform whatever data entry is required, and then update the row. Therefore, it makes all other text-editing controls on the data access page read-only and disables all other elements in the section to which it is bound until the user picks an action. Then, the elements are enabled to make it possible for the user to enter data. The LockFieldsBeforeEdit property can be set to False to stop the toolbar from disabling data-bound elements.

When a user clicks an action button in the toolbar, the control fires a ClickAction event. Client script can be attached to this event to implement custom behavior for the toolbar buttons. For details, see Scripting with the Workflow Toolbar.

After the event is fired, the action performed by the toolbar control depends on the type of workflow action.

Workflow action Toolbar control action
Transition or Update Sets the workflow state value to the next state and enables all data-bound controls.
Create Inserts a new record, sets the row position to that record, sets the state value to the next state, and enables all data-bound controls.
Delete Deletes the current record.

The toolbar control provides a CancelEvent method that can be called during the Click event process to stop the toolbar control from performing the Update, Insert, or Delete actions if you want to implement custom behavior instead.

Note   If you are using the Access record navigation control in conjunction with the Workflow Toolbar control, you may want to hide the New and Delete buttons on the navigation control, because the toolbar has buttons for creating and deleting records that conform to the workflow rules. To hide these buttons, select the Other tab for the navigation control's properties, and set the ShowNewButton and ShowDeleteButton properties to False.

Offline Redirection

The toolbar control maintains its own copy of the Microsoft Access data source control's connection string. At run time, it checks the current online state of the browser. If the OfflineRedirect property is True, the control creates a connection string to the local store when working offline. This connection always uses the OLE DB provider for Microsoft SQL Server™, and uses the user portion (minus domain) of the currently logged in user as the database user name. This user account is created by Microsoft Office Developer client setup. Then, the toolbar control sets the data source control's connection string to redirect it to the local store.

If the toolbar control cannot open the connection because of a login failure, a prompt appears making it possible for the user to enter a different password. This password is encrypted and stored in the registry to avoid having to prompt again for future connections.

Offline Menu

In addition, the toolbar provides an Offline menu option that makes it possible for users to synchronize changes, make the solution available offline, or remove the offline subscription.

The Offline menu option can be hidden by setting ShowOfflineButton property to False.

When the user clicks the Offline menu option while online, the toolbar control queries the solution database for a list of offline publications and populates the Make Available Offline sub-menu with this list. If the user has subscribed to a publication already, it appears selected in the sub-menu.

The following options are available to users from the Offline menu:

The Synchronize Now and Make Available Offline menus are disabled while working offline or if there are no publications available to the user. The Offline menu options are only enabled if the page has been loaded using HTTP.

Note   When creating data access pages, to test the Offline menu option, from the File menu, select Web Page Preview.