There is an idea on the Idea Exchange about looking for a way to close all tabs in a Lightning Console App. It’s an existing option in Classic that hasn’t yet made its way to Lightning.
Lightning Console: Close all tabs option
I’ve spent way too much time manually closing tabs and wanted a way to make this easier.
There is some debate in the comments on the idea exchange about whether or not to leave pinned tabs open when performing a Close All tabs. I designed my component to take a single parameter to specify if pinned tabs should be closed or left open.
It’s easy to implement on the Utility Bar.
When selected, it pops up a Close Tabs button and the component takes care of the rest.
The component consists of three parts:
- Markup (closeConsoleTabs.cmp)
- Design (parameter) File (closeConsoleTabs.design)
You can get the complete source code and installation instructions here:
Check it out and take advantage of a great time saver.
11 thoughts on “Close all Tabs in a Lightning Console”
Hi, the code isn’t available, you can upload it again please!
The link has been updated: https://github.com/ericrsmith35/Lightning-Components/tree/master/src/aura/ersCloseConsoleTabs
The Winter ’19 release as included a keyboard shortcut (SHIFT + W) to now close all unpinned tabs within a Salesforce Console.
LikeLiked by 1 person
Hi, Eric! Thank you for creating this. It’s generally easier for our users to have something that they can quickly click to do this as opposed to remembering keyboard shortcuts. With that said, I did discover an issue with it whenever I close 13 or more main Tabs. Basically, whenever the “More” drop-down appears. Whenever there are 13 or more Tabs and I utilize the Close Console Tabs Utility Item, the screen gets a little dark, the Tabs close, and I’m presented with a “Sorry to interrupt” SF Page Error. It happens every time I use it with 13 or more main Tabs. The keyboard shortcut closes them all out without issue. I’m not sure if there’s anything that can be done with how it’s coded but wanted to make you aware. Feel free to email me with any questions!
Thanks for the update. I looked at the source code and I have no idea why this would be happening.
Yeah, I figured there probably wasn’t much that you could do on your end. Thanks for checking! What’s strange is that the “Sorry to interrupt” message disappears after about a second so I can’t even provide feedback to SF on the issue. Out of curiosity, are you able to replicate the issue? It occurs in both my Sandbox (full) and Production orgs so I don’t think it’s isolated but you never know.
I tried it from the Utility Bar with 36 Tabs open and it worked fine.
Interesting. Thanks for checking! Will setup a debug log and see what I can figure out.
We have this issue when there are tabs under the more and we change the order of those tabs. Seems to be an issue with focus tab.
[LCE: workspaceManager#processWorkspacePage() – Failed to process request: jobLibrary – Job: processWorkspacePage, Stage: tasks, Job failed. An error occurred while processing. LCE: workspaceManager#activateTab() – Failed to activate workspace: ctab12, Status: false] h.eval()@*****lightning.force.com/components/navex/workspaceManager.js:42:318 eval()@*****lightning.force.com/libraries/one/jobLibrary.objects.js:7:73
The issue occurs when the focus is not on the last tab. The error message is shown only when you have a pinned tab. A workaround we have is to move the focus on the last tab and then close all the tabs.