How to close upper tab?

Community Alums
Not applicable

In this screenshot, there are two sets of tabs, upper and lower.  Is it possible to close the upper tab from within a UI action?  I can only figure out how to close the lower tab.

 

find_real_file.png

5 REPLIES 5

Allen Andreas
Administrator
Administrator

Hi,

The UI Action would apply the client script to the specific table/record that brought in the UI Action. Then using the follow script (which I'm sure you're using now) is how you'd close it: https://docs.servicenow.com/bundle/rome-servicenow-platform/page/administer/workspace/task/close-tab...

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hello Allen.
Could you please provide here the example of a script to close a tab on Workspace?
Unfortunately, there is no possible to browse the page under the link that you provided

Vadzim Surin1
Tera Expert

Hello Dustin.
Could you please share how to close lower and upper tabs on Workspace if you already figured it out?

sushant06251
ServiceNow Employee
ServiceNow Employee

We can do it by dispatching "SCREEN_STATUS_CHANGED" event with a payload { status: "closed" }

Add a new dispatched event in Body component named "SCREEN_STATUS_CHANGED" and add payload using advanced flag as "status" as string.

Screenshot 2024-03-26 at 4.42.43 PM.png

 

Screenshot 2024-03-26 at 4.42.34 PM.png

 

 

 

 

 

 

 

 

 

 

 

 

 

On your event handling for the button, add SCREEN_STATUS_CHANGED event with the payload status=closed and save it.

Screenshot 2024-03-26 at 4.42.10 PM.png

 

 

Now when you click on the button, it will close that tab.

 

Please mark as helpful if it answers your question.