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
bhindusaran1bhindusaran1 

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

Hi,
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 ?


Thanks
Bhindusaran.v

hwdavidhwdavid

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

AMCDeveloperAMCDeveloper
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.
hwdavidhwdavid
That's not really a solution. I have a managed package and I am using RunApex. This should work with the namespace.
AMCDeveloperAMCDeveloper
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.
ovadbar@gmail.comovadbar@gmail.com

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".