Friday, April 10, 2020

Open Lightning Component in New Tab in Lightning Console

Let's Start with List View Button:-

If  component needs to be opened from list view, then it has to be custom list view button, on click on this button component will open in new tab as shown in below diagram.




Suppose my component name is Create Case with Task, create new lightning tab for it.




Make sure to implement  "force:appHostable,lightning:isUrlAddressable, 
flexipage:availableForAllPageTypes, force:lightningQuickAction" in component, so that it will be visible while creating tabs and quickaction.

Create List view button on object as shown below, 



Suppose my lightning tab name is test1, then my tab url would be /lightning/n/namespaceprefix__test1(tab name).

You are all set to add this button in object list view.

Note :- There is still a know issue on this, Custom List button in lightning console leaves blank workspace tab when navigating away from the List View
https://success.salesforce.com/issues_view?id=a1p3A0000003eyZQAQ


But if user don't select check box "Display Checkboxes (for Multi-Record Selection)" while creating list view button, this issue will not appear.