function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Parteek Goyal 52Parteek Goyal 52 

how to call lightning component with custom lightning button

Hi All,

I have a lightning custom button in lightning component and I want to call the another lightning component on click of this button. 
Please help me to achive this. 
Thanks in advance.

Parteek
Naveen Kumar B H(bhns)Naveen Kumar B H(bhns)
Hi Parteek,

Check below link. It will help you to accomplish your requirement.

https://salesforce.stackexchange.com/questions/82149/lightning-components-can-helpers-call-other-helpers

Let me know if you need more help.

Regards
Naveen
Parteek Goyal 52Parteek Goyal 52
Hi Naveen,

thanks for your quick response but I think above example is used for call another function. 
I just simply want to call a component on button click.

Parteek
Naveen Kumar B H(bhns)Naveen Kumar B H(bhns)
Hi Prateek,

can you please elaborate your requirement?

On click of button, do you want to display a hidden component? or do you want to display a lightning component on click of Custom lightning button like detail page button?

Regards
Naveen
Parteek Goyal 52Parteek Goyal 52
Hi Naveen,

Thanks for you response.
I want to display a lightning component on click of custom lightning button like detail page button.

Thanks,
Parteek
Naveen Kumar B H(bhns)Naveen Kumar B H(bhns)
Hi Parteek,
Go through below link.

https://trailhead.salesforce.com/en/modules/salesforce1_mobile_app/units/salesforce1_mobile_app_actions_global

https://webkul.com/blog/how-to-create-a-custom-button-on-record-page-in-lightning-experience/

http://www.sfdcmonkey.com/2017/04/16/add-lightning-component-lightning-action/

Regards
Naveen
 
Abhishek915Abhishek915
Hi Prateek,

First of all, you need to implement 'force:lightningQuickAction' in your lightning component. After that only it will be available for using in the Action of an object.

You can go through the detailed explanation how it can used in a new Action by following the below link.

https://webkul.com/blog/how-to-create-a-custom-button-on-record-page-in-lightning-experience/

Please mark as Best Answer, if your issue is fixed.