Access Controllers From Visualforce Pages in Different Packages with @namespaceAccessible

To access an Apex controller from a Visualforce page that is in a different package, use the @namespaceAccessible Apex annotation. By default, Visualforce pages installed in a second-generation packages can't call a public Apex method from an Apex class in another package.

Where: This change applies to Lightning Experience and Salesforce Classic in all editions.

How: Include the @namespaceAccessible Apex annotation in your custom controller class so that Visualforce pages can access controllers that are in another package.