I know that I can hook a component/app to a controller like this:

<aura:component controller="IncidentsController">

However, is it possible to get this component to communicate with more than one controller?


  • I don't think it is possible.. In VF page as well we use extension for multiple controllers.. But I am commenting here because I am not sure.
    – Ratan Paul
    Commented Jan 18, 2016 at 7:38
  • Can I use an extension with aura? Commented Jan 18, 2016 at 11:04
  • I don't think so...but what exactly are you trying to accomplish...what is the logic you want to put in the "extension" as opposed to the controller?
    – pchittum
    Commented Jan 19, 2016 at 1:04
  • I have a lightning component which includes javascript which is basically a React + Flux application. I can communicate with the Apex server using the lightning component. However, I can only communicate with 1 controller. If I need to communicate with a different controller, I will need to a add another component just so it will associated with a different controller. Does that make more sense? Commented Jan 19, 2016 at 5:36
  • Based on this post you can't do that unless I am misunderstanding. I want to do the similar thing but with remote object. But after my research I only can implement lighting component with aura. I hope I am wrong. salesforce.stackexchange.com/questions/100412/…
    – user3211
    Commented Jan 20, 2016 at 18:32

4 Answers 4


Yes and No , no way so far for multiple apex controllers link to one aura component. but component allows include child components or inherited from super component. Each component has one controller.

using inheritance

<!-- BaseComponent -->
<aura:component extensible="true" controller="BaseComponentController">

<!-- child component -->
<aura:component extends="BaseComponent" 

Invoke Base component helper method from child component, then invoke BaseComponentController methods.

for example in childhelper.js

doStuff: function(component,event, helper){
  //call base component helper deleteRecord method

  //call apex childComponentController method doStuff
  var action = component.get("c.doStuff");


in basecomponentHelper.js

deleteRecord : function(component){
   var baseCmp = component.getConcreteComponent();
   //call apex BaseComponentController delRecord function
   var action = baseCmp.get('c.delRecord');


or adapt the same idea to invoke Apex controller from child component.

  • Very inflexible design...
    – dzh
    Commented May 5, 2020 at 3:08

I think your best option is using component.find and helper components:

   <c:OpportunitiesSelector aura:id="oppsHelper" />
   <c:ContactsSelector aura:id="conHelper" />
   <ui:button press="{!c.doSomething}" label="Do Something" />

Then in controller you'd go:

doSomething : function (component) {
    var action = component.find('oppsHelper').get('c.getOppsById');
        ids: [123456789012345678, 098765432187654321]
    var action2 = component.find('conHelper').get('c.getContactsByEmail');
        email: '[email protected]'

All your OpportunitiesSelector has to have is:

<aura:component controller="OpportunitiesSelector" />
  • One of the patterns that followed from this outlined here: github.com/metacursion/sfdc-lax-benedict Also now with LWC you can create such service components without using any libraries!
    – dzh
    Commented May 5, 2020 at 3:07

You cannot use two Apex controller in Lightning Component, but you can Extends the Component and use Super Component controller action in sub component.Look at this blog


However do not call Super component controller action in Sub component, because I found one note in Developer Guide

We don't recommend using inheritance of client-side controllers as this feature may be deprecated in the future to preserve better component encapsulation. We recommend that you put common code in a helper instead.


Referencing multiple Server-Side Apex controllers Classes within a Lightning Component is not supported. I don't have a specific reference to support that statement, but consider this from the Lightning Components Developers Guide. When we want to call a Server-Side Action from a component, we make a reference to the method in the client side controller like this:

    // create a one-time use instance of the serverEcho action
    // in the server-side controller
    var action = cmp.get("c.serverEcho");

The cmp.get("c.serverEcho") call indicates that we’re calling the serverEcho >method in the server-side controller. The method name in the server-side >controller must match everything after the c. in the client-side call. In this >case, that’s serverEcho.

SO... if we want to make references to two different Server-Side Apex controller Classes, we would need a means to identify the two Apex Classes as, let's say, "c1" and "c2". Only then would we be able to make a reference methods from one or the other... that's currently not supported.

Does somebody want to create an Idea in the Idea Exchange?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .