+ Start a Discussion

Open Cti integration - runApex : Could not load apex class from the test organisation

Getting the following error when tried to access apex class of installed package (managed) using openCti method 'runApex', when my test organisation has an namespace defined in it.
Error "Cannot Load Apex Class: namespace.classname"

Scenario1 :
-> Test organisation contains no namespace.
-> Installed managed package.
runApex('namespace.classname','methodname',paramString) works fine

Scenario 2 :
-> Test organisation contains an namespace 'testnamespace'.
-> Installed managed package.
runApex('namespace.classname','methodname',paramString) doesn't work.

What could be the possible reason for error ?



I just ran into this issue as well. Did you figure it out?

Issue Identified: Hope Salesforce would provide some guidance on this.

Issue: Open CTI API (RunApex) doesn’t work with Managed Package Apex Classes on Orgs that have a Namespace defined.

If you have issue with Managed Packages and RunApex, make sure you use an Org that doesn't have Namespace defined.
That's not really a solution. I have a managed package and I am using RunApex. This should work with the namespace.
I agree with you that this is not a solution.

Certanly helps others to avoid spending too much time trying to figureout if they are doing something wrong.

Hope Salesforce comesout with the root cause and a solution.

I kind of have the same issue.

On the user that I created the package. I get the error if I include the namespace but when I install the package on other organization users I need the namespace other wise I get the error. Why isn't it consistent

Rajeev C GurramRajeev C Gurram
I am also getting the same issue.

Did you guys figured it out ?
Rajeev C GurramRajeev C Gurram
I fixed the issue by calling the class name with registered namespace.
Marco KerwitzMarco Kerwitz
You may get around this by calling these classes within the "System" namespace. E.g. don't call "UserInfo" class directly, but via "System.UserInfo".