Closing a Tab in custom workspace - solution -

Rene12
Tera Contributor

Hi, I want to share simple UI action which did the trick. You must set the UI action to be client side.

 

Snímek obrazovky 2023-03-22 v 7.20.30.png

2 REPLIES 2

ThunderDev
Tera Guru

I have a question for anyone that might know, We currently use g_aw.closeRecord() in CSM Configurable Workspace. This API function works most of the time but we have experienced certain situations where it will not close the case tab. Would this cause an issue since in the documentations it says that g_aw is suppose to be used within Agent Workspace?

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.