Workspace UI Builder: open record in new tab from a record-page button — is this supported pattern?"

richardhumbles
ServiceNow Employee

goal: "Override sn_uib_base_aw.RECORD#NAV_ITEM_SELECTED for new-tab nav — multiple handlers in internal_event_mappings?"

 

richardhumbles_0-1779819359225.png

I'm trying to make a record-link click on a configurable workspace page open the target record in a new browser tab instead of navigating in-place. The page is a record page on a custom workspace (sn_app_orm_wksp). Family release: Yokohama.

When the link fires, the click flows through the event key sn_uib_base_aw.RECORD#NAV_ITEM_SELECTED. Reading internal_event_mappings on the page macroponent, that key has one OOB handler entry: a CLIENT_SCRIPT pointing at the platform script previewRecordRouteMapping. That script unconditionally sets targetRoute: 'current' via buildDefaultRoutePayload — same-tab navigation is hardcoded for every record route.

[diagram]

To override this I PATCHed a second handler entry into the same array — an EVENT type with an inline clientTransformScript (modelled on the relay pattern UI Builder uses elsewhere) returning { external: { url: '/now/cwf/agent/record/...' } }. The script has a console.log('evaluateEvent fired') at the top.

After the patch, the array has two entries. The OOB entry runs (same-tab nav still works). My EVENT entry never logs, never executes. Reordering the array so my entry is at index 0 made no difference either (OOB still fired, mine still didn't).

Specific questions:

  1. When internal_event_mappings has multiple handlers registered against the same event key, does the platform invoke all of them, or only the first? If only the first, is there any documented way to chain or replace the OOB handler on this key without modifying the OOB sys_ux_client_script record directly?
  2. Is EVENT type with an inline clientTransformScript a supported handler shape under a base UIB event key like sn_uib_base_aw.RECORD#NAV_ITEM_SELECTED? Or is clientTransformScript only invoked when the entry's event.apiName is dispatched as a relay event by something upstream — in which case the entry under this key is structurally inert because nothing emits the relay?
  3. More fundamentally: is opening a record in a new browser tab from a configurable workspace page a supported pattern at all? UI Builder's "Link to destination" handler offers same-tab navigation only — I'd like to know if that's a deliberate constraint of the workspace shell (history stack, AW state management), or if there's a sanctioned approach I've missed.

 

 

0 REPLIES 0