+ Start a Discussion
tonante27tonante27 

Linking Apex Aura Controllers to more than one Lightning Component

Hi , I have run into a dilemma.  There is a contact lightning page that we use for both System Admins as well as non-System Admins.  The issue is that for System Admins they have a Global Action button displayed when the page loads while the non-System Admin Profiles use another button for this page which is defined in the Salesforce Classic Contact Buttons' LInks, and Action section in Setups with a lightning component that is marked as overriden. However both of these buttons bring up their respective component pages when clicked and they also load in data from what appears to be the same Apex controller(s?). The Java Script controllers call the same Aura Apex methods so my question is:

Q) Is it possible that both components could be tied to one Apex class ?
Q) Does Lightning know where to find the correct methods from a class when the Java Script controller  - for each of these components  - calls those methods?   Thanks