10

I have an Apex class inside my managed package:

global class MyGlobalClass {
    global static void doWork() {
        //...
    }
}

But when I call this code from the org where this package is installed:

MyGlobalClass.doWork();

I get this error:

Variable does not exist: MyGlobalClass

What can I do to make this class available not just inside the package, but also inside org where it's installed?

1 Answer 1

19

You have to use the namespace to reference a component in a managed package. Just changing the code in the subscriber org should work. Here's the modified version you'd want to use (change packageNS as appropriate):

packageNS.MyGlobalClass.doWork();
1

You must log in to answer this question.

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