twitter linkedin facebook instagram
  • Home
  • LWC
    • LWC Tutorial
    • LWC Tricks
  • Lightning(Aura)
    • Lightning Tutorial
    • Lightning Tricks
  • Apex
    • Triggers
  • Integration
  • LowCodeLove
  • Interview Q's
  • Misc

Salesforce Socrates


There comes a need to invoke multiple server calls from one JS controller method and also to control the sequence of the execution. If you have already tried this, your first time attempting it might have been a mess.

This can be accomplished by writing the second server call inside the first setCallback method, the third server call inside the second controller setCallback method and so on. Confusing??? Let us look at the code to get a better understanding.

Apex class with three methods - which we want to invoke from the same javascript method on the lightning controller

We have a lightning button on the UI

The JavaScript controller which defines how to invoke the three apex methods from one controller method.



Hope this is useful and if you have doubts, reach out to me through the comments section. I would love to hear you out. Stay safe and happy, until next time :)

Newer Posts
Older Posts

Trending

Search This Blog

About Me

About Me

LET’S STAY CONNECTED

Total Pageviews

Labels

  • aura
  • Lightning web components
  • LowCodeLove
  • Salesforce Tips
@INSTAGRAM

Twitter

Tweets by sirireddy2212

Pages

  • About Me

Blog Archive

  • ▼  2020 (5)
    • ▼  September (1)
      • "Invoke multiple apex methods" - from single light...
    • ►  July (2)
    • ►  June (2)
Created By SoraTemplates | Distributed by GooyaabiTemplates