NOW Experience: how to open a New Tab via dispatch
You can open new tab in Agent Workspace in 2 ways: 1) Via component; 2) Via Client Script.
Component does not require any dependencies. The action name to open a new record (new tab) is called ‘REFERENCE_INFO_CLICK’. If we create a component and put it in the contextual side panel, when the button is clicked, it will open a new tab with provided details, or if the tab is open it will switch to the tab itself. This component can be used anywhere in AW, not just side panel.
import { createCustomElement } from '@servicenow/ui-core';
import snabbdom from '@servicenow/ui-renderer-snabbdom';
const REFERENCE_INFO_CLICK = 'REFERENCE_INFO_CLICK';
const view = (state, { updateState, dispatch }) => {
return (
<div>
<button on-click={
() => {
dispatch(REFERENCE_INFO_CLICK, {
"referenceInfoClick": {
// Table of record you want to open
"referencetable": "sys_user",
// Record you want to open sys_id
"sys_id": "6816f79cc0a8016401c5a33be04be441"
}
});
}
}> Open New Tab</button>
</div>
);
};
createCustomElement('x-177418-dispatch-new-tab', {
renderer: { type: snabbdom },
view,
});
You have to use GlideAgentWorkspace (g_aw) API. This one is fully documented here. For example:
g_aw.openRecord("sys_user", "6816f79cc0a8016401c5a33be04be441");
You can see in the source code g_aw.openRecord actually uses PREVIEW_RECORD dispatch which can be used in the component like this as well:

https://servicenowthink.wordpress.com/2020/06/22/now-experience-how-to-open-a-new-tab-via-dispatch/