Thank you for your feedback.
Form temporarily unavailable. Please try again or contact docfeedback@servicenow.com to submit your comments.
Versions
  • Madrid
  • London
  • Kingston
  • Jakarta
  • Istanbul
  • Helsinki
  • Geneva
  • Store
Close

Action script for List v2 context menus

Log in to subscribe to topics and get notified when content changes.

Action script for List v2 context menus

The Action script field, on the Context Menu form, defines a script. The script runs when someone selects the context menu option.

This script is client-side and runs in the user's browser. The following JavaScript variables are available to the Action script when it is executed.

Table 1. Action script variables
Variable Description
g_list GlideList2 against which the script runs.
g_fieldName Name of the field against which the context menu runs.
g_fieldLabel Label of the field against which the context menu runs.
g_sysId The sys_id of the row or form against which the script runs.
The base system uses the following code in an action script to refresh the platform view.
g_list.refresh(1);
Another example is the use of these variables in a list header menu to sort a list by the selected field in descending order (z to a).
g_list.sortDescending(g_fieldName);
Feedback