One script to manage a process
|
One of the most common script patterns that I use is when I have a process with a number of actions. In many cases this is a script to manage a particular entity. So actions can be any of Open, Add, Edit, Save, Cancel and Exit. Each action will perform a discrete series of script steps. For example, the Open action may open the current record in a card window; the Add action may open the same card window and create a new record. This pattern means that all buttons associated with the process run the same script with a different parameter (action). This centralises the process actions. It also makes it very easy to update and add to specific actions associated with a specific process. The general structure of the script is:
When the actions are specified, you simply add the required script steps in the Else If block. For more complex processes, you may decide to use this script as a "dispatcher". This would mean an action is handed off to another script using Perform Script. Do you use a similar structure in your scripting?
|