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
Sid LightningSid Lightning 

Call Apex Class method from Lightining Quick Action

Hi,

I have an apex class method already written which gets called by a button in background,
 

I want a button on Accounts screen, which can call that lightning component and inturn the apex method.

So, I want a button on Accounts screen, which calls a component that calls the method written in Apex class.
Since the method makes the API call, do I need to write some extra code? Since the functionality for API is already written.


 

chanchal_:)chanchal_:)
User-added image
You can create a lightning action, can call a lightning component and then on doInIt handler of that lightning component you can call apex method.
Sid LightningSid Lightning
I need to pass parameters as well. How can that be done
chanchal_:)chanchal_:)
You can pass parameters from lightning component as well.

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/controllers_server_actions_call.htm

Refer this link to pass parameters in an apex class.