Protecting a Form Tab
A form tab can be protected in the program, preventing user access to that tab when certain conditions are met. A form tab can be protected (disabled) by moving the value CRT-FOLDER-TAB-PROTECT to the AF field for the form tab.
MOVE CRT-FOLDER-TAB-PROTECT TO ProgramCodeF1-LOC-TabName-TAB-AF
A form tab can be unprotected (enabled) by moving the value CRT-FOLDER-TAB-RESET to the AF field for the form tab.
MOVE CRT-FOLDER-TAB-RESET TO ProgramCodeF1-LOC-TabName-TAB-AF
In the following example, when the Location Class "Other" is chosen by the user, the Guests form tab is protected (disabled).
001105 IF (LOC-CLASS = "Other")
001106 MOVE CRT-FOLDER-TAB-PROTECT
001107 TO GD01F1-LOC-GUESTS-TAB-AF
001108 ELSE
001109 MOVE CRT-FOLDER-TAB-RESET
001110 TO GD01F1-LOC-GUESTS-TAB-AF.
Form Tab Protection Considerations
-
The program should not position to a field or return a field value on a protected form tab.
-
The program logic should not flag all form tabs as protected at any one time.
-
Application program logic should not assume that a tab remains at the same protected/unprotected value that was last set by the application. Applications must protect the tab again when the transaction returns.
-
Form tabs that are defined as secured in Environment security are automatically protected. For more information on Environment security, see Lawson Administration: Resources and Security.