• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 7. Creating Simple Scripts > Creating Sub-scripts

Creating Sub-scripts

You don't have to use the default script as your starting point for a script unless it contains most of the actions you need. You can create small sub-scripts that do one or two specialized tasks, then combine them with a more generic larger script to execute a variety of actions. These scripts may only contain one step apiece, but they allow you to retain a variety of settings without having to re-search or re-sort each time you want to create a variation on one script idea. For example, if you frequently have to sort your files by Last Name, you can pre-set your database with this sort, then create a sub-script that only has a Sort step in the script. Then you can add this sub-script to any other script—for updating accounts payable or analyzing account payment patterns—as you need it. We use this strategy to create a search script for payments by check.

To create a sub-script to find records:

Go to Find Mode. Go to the layout that contains the fields you need for your search. Input your criteria on the layout and click Find in the status area. In our case, we go to the Sales layout and search for all sales that were paid by Check (Figure 7.21).

Figure 7.21. To use the restore option, you must do a search before creating the script.

Choose Scripts > ScriptMaker.

When the Define Scripts dialog box appears, type Find Checks in Script Name and click Create (Figure 7.22).

Figure 7.22. This script will find all the payments made by check.

The Script Definition dialog box will appear with the default script in the assembly window on the right. Click Clear All to delete the default steps (Figure 7.23).

Figure 7.23. Clear All deletes all steps in the assembly window.

Scroll down to the Sort/Find/Print category in the left window and double-click Perform Find. Leave “Restore find requests” checked in Options to maintain the find criteria (Figure 7.24). Click OK.

Figure 7.24. This script will restore the current find request.

Click Done to finish. You now have a script that will just find all of the records that were paid by check.

To create scripts for other types of payment, follow these steps but substitute other payment types. In our example, we created a total of four small scripts sorted for Cash, Purchase Orders and Credit Cards as well as Check (Figure 7.25).

Figure 7.25. A separate script is required for each find request.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint