"g_aw" does it work in catalog client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 10:00 PM
Hi All,
Currently i have a ui action in workspace called "Open record producer". Once i click on it, it opens the record producer in a new tab.
Now i need to close the tab once the record producer is submitted.
I tried with onsubmit catalog client script by adding g_aw.closeRecord();
Still that is not working.
Is there a way i can close the tab in a workspace?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 10:08 PM
Hello @Prem13 ,
To Close the Window
Write a on submit script which actually run window.top.close(); and close the window after submitting. We need to make sure that this on submit should be the last running onSubmit script
To redirect
Use action.setRedirectURL("URL") in Record producer to send the use to sign out page.
Hope this helps..
Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 10:22 PM
Hi Nayan,
I already tried both window.top.close() on onsubmit catalog client script gives me javascript error though the isolate script is false.
And action.setRedirectURL("URL") is not working in workspace. I tried with producer.portal_redirect that worked but its opening a window within a tab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 10:08 PM
you are writing catalog client script which is running on catalog item view?
But as per your question the UI action is in normal form
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 10:16 PM
Hi Ankur,
Thanks for replying..
Yes Ankur. The Ui action is on a specific table which will opens the record producer from the workspace.
So I'm trying to create an incident for a specific HR case in workspace
Once the user submits the record producer i need to close the current tab (Record producer tab)