Using menu items to control a state machine
In this section, we will actually add the state machine to the form, so we can use it. Using menu items for this is a nice concise way to control the state machine, and follows the UI patterns found in other areas, such as the projects module.
Getting ready
The prerequisite for this recipe is that we have a table with a state machine that has been generated.
How to do it...
To create the state machine menu items, follow these steps:
- Add a new action menu item to the project named
ConWHSVehInspStatusWaiting
. Complete the property sheet as follows, in the order stated in the following table:
Property | Value |
State Machine Data Source | ConWHSVehicleTable |
State Machine Transition To | Waiting |
Label | The label you use in the Waiting state's |
Help Text | The label you use in the Waiting state's |
Needs Record | Yes |
- Create the menu items for the remaining states (
InProgress
andComplete
) following the same pattern. - Open the
ConWHSVehicleTable
form...