Set up UI actions to customize legacy workspace for your organization. UI actions include custom buttons, menu items and limiting access to forms based on a user's role.

Before you begin

Role required: workspace_admin

About this task

UI actions appear either as form buttons or list items in the UI action menu.

UI action buttons and list items

Each workspace comes preconfigured with UI actions. You can, however add to or remove preconfigured UI actions.

You can hide UI Actions for people who do not need to take action on records. For more information, see Hide the Details tab and UI Actions.

Procedure

  1. Navigate to All > System Definition > UI Actions and click New.
  2. In the form, fill in the fields.
    Note: Other fields than those in the following table appear in the form but they do not function in workspaces. For more information on each field on the UI actions form, see UI actions.
    Name UI action name. This appears in the workspace UI, for example, Assign incident to me.
    Table Table the UI action applies to. Every time an agent displays a record from this table, this UI action appears.
    Order Placement in the horizontal list of UI actions. From left to right, the Order numbers go from small to large.
    Action name Equivalent of Name that appears in logs and table columns, for example, assign_incident_to_me
    Active Toggle to make the UI action appear.
    Show insert Toggle to insert the record change into the Table.
    Show update Toggle to show the update in the Table.
    Client

    Toggle to make the system check for client-side scripts. The default is server-side scripts. Use the GlideAgentWorkspace API in a script to open a specified record an Workspace tab.

    Overrides UI Actions that override this UI Action.
    Comments Description of this UI Action.
    Hint Describes the UI action when the mouse hovers over the UI action.
    Onclick Action taken with mouse click on the UI Action, for example, confirmAndDeleteFromForm().
    Condition Conditions that must be satisfied for the UI Action to appear, for example, current.isValidRecord() && current.canDelete().
    Script Server-side script that implements the UI action.
    Application

    Application that this component applies to. Global means that the component applies to all applications.

    Form button Toggle to show the UI Action as a button in the form pane.
    Form context menu Toggle to show the UI Action as a tab in the Related Items menu.
    Form link Toggle to show the UI Action as a link in the form pane.
    Form style
    • Primary—Colors the UI Action blue.
    • Destructive—Colors the UI Action red.
    • Unstyled—Does not color the UI Action.
    List banner button Toggle to show the UI Action as a button in the list banner.
    List bottom button Toggle to show the UI Action as a button at the bottom of the list of records.
    List context menu Toggle to show the UI Action as an entry in the context menu of the list.

    Context menu

    List choice Toggle to show the UI Action as a drop-down list of choices in list view.
    List link Toggle to show the UI Action as a link in list view.
    List style
    • Primary—Colors the UI Action blue.
    • Destructive—Colors the UI Action red.
    • Unstyled—Does not color the UI Action.
  3. (Optional) To create a server-side script that implements the UI action, enter the script in the Script field.
    For example, if you want to include the caller name and the short description in an incident that is created from an interaction record, you could use the following script that uses GlideRecord
    if(current.update()){
    	var inc = new GlideRecord("incident");
    	inc.newRecord();
    	inc.caller_id = current.opened_for;
    	inc.short_description = current.short_description;
    	action.openGlideRecord(inc);
    }

    The system ignores any client scripts that are included in this field. You can only use the workspace client script field for client scripts.

  4. (Optional) To create a client-side script that implements the UI action, see Supported client script types and APIs and Service Portal and client scripts.
    Note: In the client script form, you must select the Isolate Script option for a client script to work in a legacy workspace.
  5. In the Workspace tab, select: Workspace Form Button to make the UI action appear on the line of UI actions, or Workspace Form Menu to make it appears as a list item in the menu list.
    • Workspace Form Button to make the UI action appear on the list of UI actions.
    • Workspace Form Menu to make the UI action appear as a list item in the menu associated with UI actions.
    • Format for Configurable Workspace allows the UI action to appear in configurable workspaces.
      Note: For new UI actions, if a user selects Workspace Form Button or Workspace Form Menu, this property is automatically selected.
      • If a user tries to select Format for Configurable Workspace before selecting Workspace Form Button or Workspace Form Menu, an error message appears.
      • If a user only wants the action to appear in Legacy (non-configurable) AWS, then they should de-select this check box.
      • If a user wants an existing UI action to show up in configurable workspaces, they need to select this check box and save the record.
  6. (Optional) In the Workspace Client Script field, create a workspace-specific client script.
    Workspace has similar client scripting limitations as Service Portal. For example, to open a form by clicking it, you could add the following client script:
    function onClick(g_form) {
    
    }
  7. In the Requires role tab of the workspace section, add any roles that you want to limit access to the UI action to.
  8. Click Submit or Update.

What to do next