function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
james2000james2000 

Calling a global class/method that is in a managed package

I'm wanting to create a managed package that contains Apex classes and methods that can be called from the org that installs the managed package.

 

I assumed all I had to do was make my Apex classes and methods global using the global keyword. However, when I try to call a method from an org that has the package installed, I get the error "Method does not exist or incorrect signature".

 

I've tried calling the method with and without the namespace. Can someone please tell me if this is supported or if there is some trick to getting this to work?

 

Thanks 

Best Answer chosen by Admin (Salesforce Developers) 
james2000james2000

I found the answer in the apex reference - namespace_prefix.class.method(args).

 

This is inconsistent with the format for referencing VF components or static resources that uses the double-underscore (__) after the namespace prefix which is what I was expecting.