I am currently trying to override the Add Products button on opportunity detail page to show a lightning component. For this I have created a visual force page and calling the Lightning Component(Modal) from it. But this navigates page from the detail page to the component page. My question is is there any way we can show the modal in the visual force page on the detail page itself? or is there any other why in which i will have to create my visual force page? I have included the code for the page below.

<apex:page standardController="Opportunity">
<apex:includeScript value="/lightning/lightning.out.js" />
var profile = '{!$Profile.Name}';
$Lightning.use("c:ModalApp", function() {
        { "recordId" : '{!$CurrentPage.parameters.oppId}',
         "profile" : profile},
        function(cmp) {
            console.log("Component created!");
<div id="theOpp"></div>


You can achieve this by using a Lightning Component alone. There is an interface called lightning:actionOverride by which we can call a lightning component from actions / buttons.

Refer here for details.

  • I tried creating the component as mentioned in the link. I then overrode the standard edit button on the related list for Add Products. Still the component navigates to a new page. @Junaid P Khader – user3197916 Feb 22 '18 at 9:49
  • @user3197916 From related list, we dont have an option to go directly to Lightning Component. Why cant you create a new Action in opportunity and override it with Lightning Component ?. I hope this will solve your issue. – Junaid P Khader Feb 22 '18 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.