Learn Goal 5 - Part 3: Add a button to perform your new script

Document created by Kedar on Dec 10, 2014Last modified by communitymanager on May 12, 2015
Version 26Show Document
  • View in full screen mode

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.




  1. Choose the View menu > Layout Mode  ⌘L or Ctrl-L

  2. Select the Button tool from the status toolbar.

  3. 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.
    button setup dialog.png
  4. Type the following button label into the empty box: + Add Work
    button add work.png
  5. For the Action, select "Perform Script".

    A Specify Script dialog box appears.

  6. Select the “Create New Work Order” script that you just created.

  7. 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.

  8. Click in the upper left corner of the Button Setup dialog box to dismiss it.

  9. In the Inspector, choose the Styles tab.

  10. Change the style of the button from “Default” to “Accent Button 2”.
    accent button style.png

    The button will turn green.

  11. Choose the View menu > Browse Mode  ⌘B or Ctrl-B

  12. Select the “Work Orders” tab

  13. 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.