opening a record in a new tab in workspace from ux list action client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2022 01:41 PM
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.
- Labels:
-
UI Framework Next Experience
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 08:42 AM
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();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2024 01:45 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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...
