opening a record in a new tab in workspace from ux list action client script

Michael Culhan1
Mega Sage

How can I open a record in a new tab from a ux list action (sys_declarative_action_assignment) client script?  I tried g_aw.openRecord but I get undefined in the browser console.  g_list works but not g_aw.

 

I can use top.window.location top open the record but this refreshes the whole page.

 

More details:

I have a ux list action (sys_declarative_action_assignment) that uses the g_list.getChecked() api to get the interactions selected from a list, sends them to a script include via GlideAjax, the script  include creates a new targeted communications record with the recipients that are selected and then returns the sys_id of the new record to the client.  I want to open this record in a new tab in workspace. 

3 REPLIES 3

Michael Culhan1
Mega Sage

This is a defect according to support and will be remedied in a future release.  In the meantime, I've been using the below which opens the record in a new browser tab

 

var win = top.window.open('now/cwf/agent/record/[tablename]/[sysid]);
win.focus();

  

Kshitij3
Tera Contributor

Hello  Michael Culhan1;

 

I have similar requirement can you help me with how you are returning the sys_id of record created through glide ajax. I am not able to get response from Glide AJAX called from declarative action.

Henalu
Tera Contributor

g_aw.openRecord returning undefined from a list action is a known defect from that era. top.window.open() does work but it opens a browser tab, not a workspace tab — which is usually not what you want.

 

The approach that works reliably in Xanadu/Zurich is using an Event Handler that returns { external: { url, target } } — Next Experience intercepts that and routes it as a workspace tab. It's not documented well, but it's the framework's intended navigation mechanism. But only managed to make it work from UI Builder. When using declarative actions I had to open new tabs on the browser, could not manage to open them inside of the workspace without reloading the whole page. 

 

I wrote up the full pattern here if it helps (in Spanish, Google Translate handles it well): https://breaking-trail.vercel.app/articulos/ui-builder/navegar-registro-workspace-desde-event-handle...