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
Anu Singh 40Anu Singh 40 

how to call Apex class in Account detail page on button click in lightning?

Hi All,
I need to call Apex class in Account detail page on button click in lightning. How can I do it.
ShivankurShivankur (Salesforce Developers) 
Hi Anu,

Please check with below help article to understand, how you can call apex methods from a button.

Link: https://help.salesforce.com/articleView?id=000325250&type=1&mode=1

Hope above information helps, Please mark as Best Answer so that it can help others in the future.

Thanks.
KrishKeerKrishKeer
Visual force page is old way, i assume.  I would rather create a simple lightning component.  Create an action (buttons/actions of the account object) using that component and add to the page layout.  
KrishKeerKrishKeer
https://www.youtube.com/watch?v=GR391DG9peE
Good video on what I was referring above to add a button to a SF page.