The g_aw API enables a UI Action or client script to open a specified record in an Agent Workspace tab.

There is no constructor for the GlideAgentWorkspace class. Access GlideAgentWorkspace methods using the g_aw global object.

GlideAgentWorkspace - closeRecord()

Closes the currently open record, such as a form, in a subtab within Agent Workspace.

Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
None

Example

The following example saves the content of the tab and then closes it.
function onClick(g_form) {
function onClick(g_form) {
  g_form.save().then(function(){
    g_aw.closeRecord();
  });
}

GlideAgentWorkspace - openRecord(String table, String sysId, Object params)

Opens a specified record, such as a form, in a subtab within Agent Workspace.

Note: This method is only available in the Agent Workspace client scripting environment or in a UI action on the workspace client script field.
Table 4. Returns
Type Description
None

Example

Open a sys_user record in a subtab.

g_aw.openRecord('sys_user', '62826bf03710200044e0bfc8bcbe5df1'); 

Example

Open a record in a subtab where all fields are read-only.

g_aw.openRecord('sys_user', '62826bf03710200044e0bfc8bcbe5df1', {readOnlyForm: true}); 

Example

Open a record in a subtab and go directly to the "Groups" related list.

g_aw.openRecord('sys_user', '62826bf03710200044e0bfc8bcbe5df1', {defaultTab: "sys_user_grmember.user"});  

Example

Open a record in a subtab but only show the form header and other tabs.

g_aw.openRecord('sys_user', '62826bf03710200044e0bfc8bcbe5df1', {hideDetails: true});