"g_aw" does it work in catalog client script?

Prem13
Tera Contributor

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();

Prem13_0-1690952363843.png

 

Still that is not working.

 

Is there a way i can close the tab in a workspace?

 

10 REPLIES 10

Hello @Prem13 ,

Did you try my solution with try writing an on submit record producer script?

If my answer solved your issue, please mark my answer as Correct & Helpful based on the Impact

Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.

Hi @Nayan Dhamane ,

 

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

@Prem13 

that method will only work for workspace table and not for native form

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar is there a way i can close the tab in workspace or redirect to the main form

@Prem13 

check this link

https://www.servicenow.com/community/next-experience-forum/ui-builder-close-tab-and-redirect-back-to... 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader