Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

How to trigger a client script when a workspace tab is closed

Steph_Fagnant
Tera Contributor

Is there a way to trigger a client script when a workspace tab is closed? We have an application in the FSO workspace. When the user clicks on the 'X' to close the tab on the right and return to the Home tab, we want to execute a client script to update some data.

 

Steph_Fagnant_0-1777063944378.png

 

Has anyone dealt with a similar type of situation? So far we have been unable to come up with a way to recognize when the tab is closed. Things like a beforeunload event have already been eliminated as options due to browser restrictions. There are no associated data changes, so something like a record watcher event isn't an option, either.

2 REPLIES 2

Naveen20
ServiceNow Employee

Try as below and it should work. I have tried in the SOW SRP page. Check screenshots

Tanushree Maiti
Kilo Patron

Hi @Steph_Fagnant 

 

Check this blog and demo: How to open a new workspace tab and close an existing tab in UI Builder

 

Also refer: Close event on closure of 'custom workspace' tab 

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: