When designing your screens, you can create actions where the execution is triggered by an event such as clicking on a link or a button. These actions are called Screen Actions and are normally used to implement the business logic that implements business rules, for example, to validate and submit a purchase order.
A Screen Action can have input parameters and local variables. There are no output parameters in a Screen Action.
You have a specific editor to design the behavior of Screen Actions, that is, their action flow. In this editor, you can select any tool available in the Action Flow Toolbox to be executed in the action flow of your Screen Action.
Most of the time, you'd like your web screen or web block action to simply end and "stay" in the same screen, keeping current execution context. This behavior is especially useful when submitting a web form. When validating the inputs provided by the end-user, you want to provide visual feedback to the end-user, preserving the values he/she typed in the screen (unless they have bee explicitly changed by your logic).
For this purpose, you must use the End element to end the screen action flow. When ending a screen action in this way, the screen will not be reloaded and will be redrawn according to the way that the Screen Action is being executed (for further details see below the section Executing a Screen Action):
Using Submit - The screen will be redrawn: This means that, the screen preparation is executed in the current context and afterwards, the whole screen is rendered, maintaining the values the end-user typed in the screen.
There are some exceptions to the behavior described above for the end-user typed values:
All widgets that accept input and that are inside List Records or Table Records widgets do not keep their values after an End element.
Using Ajax - Only parts of the screen will be redrawn: This means that, only the screen parts explicitly refreshed with the Ajax Refresh Tool are rendered, maintaining the rest of the screen state.
When the form is finally submitted, you may want to reload your screen or simply flow to a different screen that, for example, lists all the records of a particular entity. In this situation, you must use a Destination element in your screen action, as you'll see in next section.
When a particular path of a flow of any type needs to reload the current screen, or to redirect the flow to a different screen, or even to an external site, you must use the Destination element to end that path of the flow. This means that the destination screen is always loaded even if it is the current screen.
After dragging a Destination tool to the canvas, an (Undefined)Destination element is created in your flow. You must specify where the flow goes from here, by setting its Destination property. The possibilities are: All the screens and external sites that are graphically connected to the current screen, all the screens and external sites that were created as a Frequent Destination and the current screen itself.
Screen Actions are executed in the scope of the screen. Therefore, when editing expressions in your screen action flow, you have access to the following elements in the scope:
Screen input parameters, screen local variables, and the runtime properties of widgets (except screen local variables of data type Object);
Queries and variables of the screen preparation;
Execute Action output parameters of the screen preparation as long as the Execute Action belongs to all paths of the screen preparation flow (except execute action output parameters of data type Object);
The screen action local variables and the queries invoked in the screen action;
Execute Action output parameters of the screen action. To use them in, for example, an Assign element, the Execute Action must precede the Assign in all paths to the Assign element in the screen action flow.
Anyway, when you're editing your screen action flow, all the elements available in the scope are present in the Scope tree of the Expression Editor, in a case where you're editing an expression; or in the variables tree of the Select Variable window, in a case where you're trying to use a variable.
Screen Actions must be explicitly invoked by its interactive elements, just by setting the Destination property of these elements:
About Actions | Action Flow Editor | Widgets with Ajax Capabilities