Navigation handler
-
- UpdatedAug 3, 2023
- 2 minutes to read
- Vancouver
- Navigation and UI
A navigation handler is a scripted view rule and runs each time data from the specified table is requested in the form view.
Example
The following script comes from navigation handler included with the HR plugin. The script forces records from the table in the Table field to use ESS view for users with no roles, and default view for all other users.
Run navigation handlers before or after view rules
Use the glide.ui.view_rule.check_after_nav_handler system property to control the order in which view rules and navigation handlers are applied. Set the property value to True to process view rules after navigation handlers. If the system property does not exist in your instance, the navigation handler always takes precedence.
The system property only overrides the navigation handler if the navigation handler scripted
function does not return an answer. In the example script above, the property has no effect.
This is because this navigation handler always returns an answer due to the
answer
line being outside of the if
statement.
Example
This example is a modified version of the previous script. In this case, the
answer
line only occurs when the user has no roles. If the user has roles,
answer
is never reached, and view rules on the same table, if any, are
applied.