Once you give a script a name and save it, you can run it just by clicking a button.
Add a button to the Work Orders tab that will run the “Create New Work Order” script, making it easier for the salesperson to create new work orders.
- Choose the View menu > Layout Mode ⌘L or Ctrl-L
- Select the Button tool from the status toolbar.
- Draw a rectangle to create a new button in the space inside the Work Orders tab below the Work Orders portal.
Note: if the button extends beyond the borders of the tab, it will be treated as though it’s on top of the tab control and won’t disappear when you expect it to.
A Button Setup dialog box appears.
- Type the following button label into the empty box: + Add Work
- For the Action, select "Perform Script".
A Specify Script dialog box appears.
- Select the “Create New Work Order” script that you just created.
- Click the OK button in the lower-right of the dialog box.
The Specify Script dialog box disappears, and the Button Setup dialog box updates to display the name of the script you selected.
- Click in the upper left corner of the Button Setup dialog box to dismiss it.
- In the Inspector, choose the Styles tab.
- Change the style of the button from “Default” to “Accent Button 2”.
The button will turn green.
- Choose the View menu > Browse Mode ⌘B or Ctrl-B
- Select the “Work Orders” tab
- Try the button out to test whether it’s working properly.
Creating the script and adding the button took some work, but think how much time will be saved by the sales team based on the automation you’ve put in place.
Whenever you consider adding a feature, you want to balance the time it takes to create it (including design, development, and testing) against the potential time saved by everyone who ends up using it.
This isn’t the only way you could have approached the problem of creating new work orders. You’ll learn other ways in the future, some arguably more elegant and sophisticated. But this method is the simplest and a good place to start.