Enhanced Support for @namespaceAccessible Annotation

The @namespaceAccessible annotation provides enhanced support for accessing interfaces, properties, and abstract classes in second-generation packages.

Where: This change applies to Lightning Experience and Salesforce Classic in Enterprise, Performance, Unlimited, and Developer editions.

How: The @namespaceAccessible annotation improvements include:
  • The @namespaceAccessible annotation now supports interfaces, properties, and abstract classes.
  • A public or protected variable or method with the @namespaceAccessible annotation must be in a class that is declared as public and annotated with @namespaceAccessible.
  • A public or protected inner class with @namespaceAccessible annotation must be enclosed in an outer class that is declared as public and annotated with @namespaceAccessible.

The enhancements on the @namespaceAccessible annotation are supported in API version 50.0 and later.