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
Sonya Dhand 14Sonya Dhand 14 

Disable Access to Non-global Apex Controller Methods in Managed Packages (Critical Update)

Hi 

Can anyone help me with what needs to be done with this critical update by Salesforce in Summer 17 Release?

https://releasenotes.docs.salesforce.com/en-us/summer17/release-notes/rn_lightning_cruc_access_public_methods_in_packages.htm

Mnay thanks

Sonya 

 
NagendraNagendra (Salesforce Developers) 
Hi Sonya,

It affects access to server-side Apex controller methods from your Lightning components. If you’ve written Lightning component code that calls non-global Apex methods in a managed package, you have some work to do.

As a reminder, the Apex methods behind your Lightning components server actions have the following access modifier requirements.

Apex methods in the same namespace as your component must be marked public or global.

Apex methods in a different namespace from your component must be marked global.

Thanks,
Nagendra
Sonya Dhand 14Sonya Dhand 14
Hi Thanks – That is what I read online as well. What I was wanting to know was if these are for custom lightning components only? All Lightning components? Or all Apex? Thanks Sonya
Mukund Gadave 16Mukund Gadave 16
Hi Sonya, 
We just need to check on custom lightning components. Earlier we can access public Apex class from manage package as a controller in lightning component. e.g below:
If we have class "public class ApexClassInManagePackage" & that is a part of some manage package (having name space "mynamespace") then we can use in lightining components like this 
<aura:component controller='mynamespace.ApexClassInManagePackage' implements='flexipage:availableForAllPageTypes' access='global'> 
Once this cricical update will be enabled on 10th Feb 2019 then controller mynamespace.ApexClassInManagePackage will not be accessible in lighting component. We need to change controller/code in our lighting component otherwise it will stop working.

I hope this answer will helpful. Please let me know if you need any detailed information.
Thanks!
 
Mukund Gadave 16Mukund Gadave 16
Hi Sonya, 
We just need to check on custom lightning components. Earlier we can access public Apex class from manage package as a controller in lightning component. e.g below:
If we have class "public class ApexClassInManagePackage" & that is a part of some manage package (having name space "mynamespace") then we can use in lightining components like this 
<aura:component controller='mynamespace.ApexClassInManagePackage' implements='flexipage:availableForAllPageTypes' access='global'> 
Once this cricical update will be enabled on 10th Feb 2019 then controller mynamespace.ApexClassInManagePackage will not be accessible in lighting component. We need to change controller/code in our lighting component otherwise it will stop working.

I hope this answer will helpful. Please let me know if you need any detailed information.
Thanks!