You need to sign in to do that
Don't have an account?
punith narasimha
How to create a custom button in lightning component with out opening component page
Hi Friends
I want to create a custom button in lead object in lightning component
when click on the custom button create a contact record
but i dont want to open any component page or alert or model box
just create a contact record these process done in lightning only
I want to create a custom button in lead object in lightning component
when click on the custom button create a contact record
but i dont want to open any component page or alert or model box
just create a contact record these process done in lightning only
Otherwise, it is not possible to create direct button in your target component.
Please add this component on the lead record page. Try the below link for add component on the record page.
https://trailhead.salesforce.com/en/content/learn/modules/lightning_app_builder/lightning_app_builder_recordpage
Please try the below code and let me know if this works for you. If still need modifications do let me know.
Component:
Controller:
Helper:
Apex Controller:
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi