+ Start a Discussion
shweta kumari 25shweta kumari 25 

How to call a lightning component from record detail page

I have a simple lightning component. which has  <h1> tag in it.
<aura:component implements="flexipage:availableForAllPageTypes,lightning:isUrlAddressable" access="global" > <h1> I am F1 Comp </h1> </aura:component/>

I have account object.

when I click any record , it will open the record detail page.

On the record detail page I need want to have a custom button, on clicking this button it will open up the above component.

The point is I will add this custom button to the page layout.

I tried using a quick action button but I was unable to add to the detail page layout.

so I create a new button then how to call the above component.

I request the forum members to help me out very urgent.


Raj VakatiRaj Vakati
You can do it with quick action
Change your code as below 
<aura:component implements="flexipage:availableForAllPageTypes,force:lightningQuickAction,lightning:isUrlAddressable" access="global" > <h1> I am F1 Comp </h1> </aura:component/>

And go and create a quick action from the above component 

add that component to the page layout ..

shweta kumari 25shweta kumari 25
I need to use a salesforce classic button to achieve the functionality.

so I created a lightning app, then vf page, called the component inside the vf page. Iused isUrlAddressable and all other interfces u described.

here VFApprovers in my visual force page.

MedConnect is package Name and Id of the record selected.

Now insdie the button (detail page Button ), URL=/apex/VYApprovers?id={!MedConnect__FDA_3500A_MedWatch_Report__c.Id}

Now when I click Approvers custom , it opens the page but doesn't display the component I require.

any issue, pls let me know