Microsoft KB Archive/247304

= MOD2000: Improper modStateID Value Displayed When NULL Workflow State Does Not Exist =

Article ID: 247304

Article Last Modified on 8/6/2002

-

APPLIES TO


 * Microsoft Office 2000 Developer Edition

-



This article was previously published under Q247304



SYMPTOMS
You find that the first non-null, defined workflow state is improperly displayed as the first record's modStateID column value in a workflow-enabled solution.



CAUSE
The Workflow Toolbar control automatically and temporarily displays the first non-null workflow state when you notice the conditions of the Symptoms section. When the record is saved, the currently displayed workflow state is also saved to the record.

This issue can occur when the solution has a defined offline subscription, uses a data access page that has a Workflow Toolbar control, and one of the following conditions occurs:


 * You take the solution offline and refresh the page to stay offline.
 * You use the solution online, and you click the New button on the Workflow Toolbar control to add a new record.

For example, you have created a workflow-enabled solution. Within this solution, you have defined non-null workflow states stored in the  StateLookup table. Assume the defined workflow states are named One, Two, Three, and Four. In the main workflow table (named ) you add one or more rows with a modStateID of NULL. You create an offline publication with the main table as the publication's main table. When you take the created data access page that has the Workflow Toolbar control offline on a computer with the Access Workflow Designer client components installed and refresh the page to continue to work offline, the first record's modStateID column value is improperly displayed as "One," instead of the currently stored NULL.



RESOLUTION
Either change the modStateID column values to the appropriate workflow state values (before or after enabling workflow on your solution) or do not allow the modStateID column values in the main table to be NULL. If you choose to modify the modStateID values after adding workflow to your solution, you must temporarily disable workflow processing (click to clear the Enable workflow processing check box on the General tab of the solution's defined workflow), save the changes, make your modStateID modifications, enable workflow processing again, and then save the changes again.



Steps to Reproduce Behavior
 On the computer with the Access Workflow Designer developer components, create a table named Items in Microsoft Access 2000 with the following columns and data types:

 Select itemID as the primary key for the table. Save the table and close it. Start Access Workflow Designer. Add the Items table (the table that you created in step 1) as the main table. Add workflow. Define the workflow states as One, Two, Three, and Four. On the General tab of the workflow process, click to clear the Enable workflow processing check box. On the File menu, click Save Changes to save the changes. Switch back to Microsoft Access. Press F5 to refresh the database objects.</li> Enter one or more records into the Items table. Be sure to leave the modStateID field NULL.</li> Switch back to Access Workflow Designer. On the General tab for the workflow process, click to select the Enable workflow processing check box. On the File menu, click Save Changes to save the changes.</li> Create an offline publication for the solution. Designate the Items table as the main table. Allow public full permissions to the offline publication.</li> In Microsoft Access, create a data access page based on the itemsView view. Add all fields from the view, except for the rowguid field.</li> Set the page header's UniqueTable property (on the page header's Data tab) to the Items table.</li> Add the Workflow Toolbar control to the page.</li> Save the page to the appropriate Web folder on the Access Workflow Designer server.</li> From a client computer where you have installed the Access Workflow Designer client components, browse to the data access page that you saved in the previous step.</li> Click the Offline button on the Workflow Toolbar control.</li> Select the Make Available Offline option, and click the named offline publication.</li> After the publication is created on the client computer, create a favorite for this page. Click to select the Make Available Offline option in the Add Favorite dialog box. (Synchronization takes place at this point, and the offline publication is created on the client computer. This process may take some time.) After synchronization is finished, click OK.</li> After the favorite has been created, click Work Offline on the File menu in Microsoft Internet Explorer.</li> In Microsoft Internet Explorer, click Refresh.</li> Click the Stay Offline button to work offline with this page.

Note that the modStateID for the first record (which should be NULL) is improperly displayed as "One".</li></ol>

<div class="references_section">