Add LWC as custom button for Related List and List View

Platform / Customization & App Building
Posted March 14, 2024
Posted Mar 14, 2024

Today, it's not possible to add a custom LWC as a button on Related Lists and List Views. Unfortunately, even after 10 years of Lightning, the only possible way is to use Visualforce, aura was never supported.

This is very useful to tackle multiple records processing that involve complex task or UI.

Today I've been using a very slow mix of Visualforce --> Lightning Out --> Aura --> LWC, that definitely doesn't help customers get rid of the idea that Lightning Experience is a slow application.

The idea would be to be able to launch a LWC from a custom button, with a list of selected Ids as input.

Being able to select whether the component is fired in a modal or taking the whole space would be nice too.

Skip Feed

I cannot believe I've been waiting for this "feature" for nearly a decade!

 

Stop looking at AI for one second and complete the missing features that used to exist in "classic". You care about customer success, please!

 

At least let us launch something configurable (flow even!?) from the list views as that has been a huge recurring pain point on every project since you forced LEX on us.


I've found a solution, Consider you want LWC on Account related List view and ListView.

 

  • Make sure you've added 'lightning__RecordAction as target and its target configs as well in your LWC
  • image

 

  • Create a quick action on the Account object, select Action Type as Lightning Web Component, and select your LWC component.
  • For related List View Button
    • Create a New Button or Link on the Child object, select Display Type as 'List Button' and Content source as 'URL'
    • In the formula box, paste '{!$Site.CurrentSiteUrl}/lightning/action/quick/Account.<Action_Name>?objectApiName&context=RECORD_DETAIL&recordId={!CASESAFEID(Account.Id)}'
  • For the List View Button
    • Create a New Button or Link on the Account object only, select Display Type as 'List Button' and Content source as 'URL'
    • In the formula box, paste '{!$Site.CurrentSiteUrl}/lightning/action/quick/Account.<Action_Name>?objectApiName&context=RECORD_DETAIL&recordId={!CASESAFEID(Account.Id)}'.

But this time put any AccountId that is valid in the URL

 

Expand Post

  • Justin Weber (Customer)

    Just confirming that this worked for me! Thank you!

Yu Ban Mena likes this.

End of Feed
8 Items
5,590 Points
563 Votes

Open
On Roadmap

Posted March 14, 2024
Posted Mar 14, 2024
Fabien Taillon