2

I have the following class structure in a managed package -

global class outerA {

    global class innerB {

    }

}

How would I reference innerB in a different package? I would have thought it would have been -

package_domain.outerA.innerB myVar = new package_domain.outerA.innerB();

but that is not working. The error I am getting is -

Type is not visible: package_domain.outerA.innerB

new package_domain.outerA() works as expected.

2
  • We need more than "that is not working." What error are you getting specifically?
    – sfdcfox
    Commented Jul 11 at 14:56
  • Updated with error message
    – Tom Ansley
    Commented Jul 11 at 14:59

1 Answer 1

3

The issue was I needed to increment the package version of the managed package in the metadata file of the apex class I was trying to update. The metadata file looked like this -

<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>59.0</apiVersion>
    <packageVersions>
        <majorNumber>2</majorNumber>
        <minorNumber>233</minorNumber>
        <namespace>simpli_lv</namespace>
    </packageVersions>
    <status>Active</status>
</ApexClass>

But the newly installed package was version 247. Once I updated the metadata to the following -

<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>59.0</apiVersion>
    <packageVersions>
        <majorNumber>2</majorNumber>
        <minorNumber>247</minorNumber>
        <namespace>simpli_lv</namespace>
    </packageVersions>
    <status>Active</status>
</ApexClass>

everything worked!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .