2

I'm just coming around to learning more about developing in lightning. still going through trailheads and whatnot. However, I can't seem to find how to do a few things.

  1. How can I override the new button on a related list in lightning?
  2. If I can't override, how can I add new buttons there and remove the standard new button
  3. How can I launch a lightning component from a relatedlist button? (I see I can still launch a visualforce page but nothing on lightning components)

Is there a trailhead on any of these topics, perhaps?

2
  • Does it not suffice to embed that component in Visualforce?
    – Adrian Larson
    Commented Mar 1, 2017 at 16:51
  • @AdrianLarson It does. Wanted to make sure there isn't a better/ preferred way to do it. Basically just want to make sure I'm following best practices
    – Tim Tom
    Commented Mar 1, 2017 at 17:52

4 Answers 4

1

As far as I know, your best bet here is still to use Visualforce and just surface lightning through that page.

<apex:page standardController="ChildObject__c" recordSetVar="children">
    <!-- include lightning here -->
</apex:page>
0

You can use a URL link to a lightning app page to achieve this as described here:

Create and activate a lightning app page that includes your component. URL is then /lightning/n/My_App_Page

0
  1. You cannot override a standard New button on the Related List rather you can create new Custom button and name it as New.
  2. In the page layout of that particular object -- go to related list you can uncheck the standard button and can add new custom buttons
  3. We can create new record by various ways using URL HACK TECHNIQUES

1. Create a new record

/lightning/o/ObjectName/new?recordTypeId={}

  1. To skip the Record Type Selection

/lightning/o/Account/new?RecordType.Name='RecordTypeName'&defaultFieldValues=AccountId__c={!Account.Id}

  1. To call Aura component and Use these variable parameters by pageReference

/lightning/cmp/c__auraName?c__id={!ObjectName.Id}&c__Object=ObjectName&c__AccountId={!Account.Id}

  1. To call LWC

/lightning/n/MYLWC

-1

To my knowledge still Visualforce embedded with Lightning component is the only option

1
  • This answer is basically an exact duplicate of that which is already accepted.
    – Adrian Larson
    Commented May 16, 2018 at 20:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .