Was this helpful?
Setting Global Field and Column Activations
The activate constant controls field and column activations for the application as a whole rather than individually specified fields and columns. You can use it to override the default behavior of the activate conditions. By default, if you define an entry or exit field activation, that activation occurs only when the user enters or exits, respectively, the specified field. If you want the field activation to occur when the user performs some other activity, such as pressing the Menu key, you can use the appropriate set_frs statement to obtain that result.
For example, assume that an exit activation is defined for the emp_name field. In addition, the program has previously executed the following set_frs statement:
exec frs set_frs frs (activate(menu)=1)
After issuing the preceding set_frs statement, whenever the user presses the Menu key while the cursor rests on the emp_name field, the FRS performs the field activation before performing any operation associated with the Menu key. (In addition, if the field activation does not include a resume next, the operation associated with the Menu key is never performed.)
The syntax for this particular variant of the set_frs statement is:
set_frs frs
     (activate(activation_type) = value
     {, activate(activation_type) = value})
The activation_type specifies the condition for an activation to occur. value must be 0, 1, or the name of an integer variable with the value 0 or 1. The value 1 turns on the activation condition; 0 turns it off. The activation_type names, their default values and the condition that each controls are listed in the following table; these values are the same as for the validation names:
Activation Name
Default Value
Activation Condition
before
1 (on)
Entering a field or column
keys
0 (off)
Pressing any control, arrow, or function key mapped to an FRS key
menu
0 (off)
Pressing the Menu Key
menuitem
0 (off)
Selecting any menu item (or function, arrow, or control key mapped to a menu item)
nextfield
1 (on)
Moving to the next field or column
previousfield
0 (off)
Moving to the previous field or column
Field activations, once set, apply to every form in the application (that is, they are global to the application). For example, the following statement turns on two possible field and column activations for every form in the application and is often issued immediately after the forms statement:
exec frs set_frs frs (activate(nextfield) = 1,
 activate(previousfield) = 1);
As another example, the following statement causes an activation to occur on the current field whenever any menu item is selected by the runtime user:
exec frs set_frs frs (activate(menuitem) = 1);
The activate column statement always executes when the user moves up or down a line in the table field. This activation is not settable. Setting the logical/environment variable II_FRS_ACTIVATE to 60 automatically sets all global field and column validation/activation options to 1 at the time the forms statement is executed.
Last modified date: 04/03/2024