@NamespaceAccessible attributes and methods not available outside package with the same namespace

Issue #2495 resolved
Gunther Roskams created an issue

Hi,

I am currently developing several managed packages with the same namespace (2nd gen packages). In Illuminated Cloud, I have discovered that when you share a namespace between two different packages and use the @NamespaceAvailable annotation, the attributes and methods are not selectable in the IDE.

Additionally, the annotation is not always allowed. This annotation can be used with a public or protected method where the class is defined as global or has the @NamespaceAccessible annotation.

In the attached screenshot, you can see the classes from both packages. On the left, you have the first package, which includes the abstract class Logging with the @NamespaceAccessible annotation. On the right, you see the second package where the abstract object is extended with additional functionality. Here, for example, the attribute "log" is incorrectly flagged as an error (while Salesforce successfully saves the class).

Comments (5)

  1. Scott Wells repo owner
    • changed status to open

    Hi, Gunther. Can you please create and attach a standalone project that reproduces these issues easily?

  2. Gunther Roskams reporter

    Hi Scott,
    I uploaded an SFDC project and created a scratch org with the namespace 'frwdpacks':

    • The package with namespace installed
    • retrieved the offline table
    • added a class with the name 'CallClassFromPackage', which is an extension of a Global class from the package. In this class, you will find the property 'mapRecordTypes' (which is owned by the global class, but has the annotation @namespaceAccessible)

  3. Scott Wells repo owner

    Thank you. I’ll take a look at this next week once the Spring '24 update has been delivered.

  4. Scott Wells repo owner

    Issue tracker grooming. If this is still an issue, please feel free to reopen, ideally with a concrete reproduction scenario.

  5. Log in to comment