The Call Routine action (previously known as Call Another Action Set) allows you to reuse a set of pre-defined actions.
As shown in the below image, there are two types of routines you can call:
- Use a set of actions from another control on the Screen.
- Use a set of actions from an App Routine defined in the App.
The parameters for this action change depending on what is selected.
Screen Call Routine Parameters
This is allows you to reuse the same actions from different control on the same screen without the need to duplicate them.
▶ Select A Routine: The control with the action set you wish to reuse. The brackets hold the event that contain the action set.
▶ Jump to this action set: Display the action set of the chosen routine.
Why You Should Use Call Routine
Imagine the screen has three different buttons with different ways of saving the record:
- Save and back
- Save and new
All of these buttons have the same actions for saving, and the last two buttons have an additional action:
In the above image, the first four actions are all the same and are required for saving the record. Imagine if the save process required another action? That means you'd have to update all three of these buttons.
However, if you use the Call Routine Action, you can do this:
The SaveBack and SaveNew buttons tells the Save button to do its actions first. So if you ever need to change how a record is saved, you only have to change it in one place.
App Routine Parameters
Using the example from the Create App Routine article, you can setup the Call Routine action as shown:
▶ Select a Routine: The active app routine defined in the current app. For App Routines with multiple revisions, the published revision is shown.
▶ Input Action Results (Only shown if App Routine requires an input): The value sent to the App Routine as input. This value can be defined by you, pulled from an existing control on the screen, or pulled from the user's session.
▶ Wait for the App Routine to finish before continuing (slower): If unchecked, then the routine will run in the background and a notification will indicate when it is complete. Warning: if actions after the Call Routine action relies on its output, do not uncheck this.
▶ Output Action Results (Only shown if App Routine produces a value): Select where you wish to store the output results of the App Routine.