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
OTDev2OTDev2 

Problem While Deploying Managed Package (Beta) on Sandbox

Hi all,

I am trying to deploy a managed package(beta) on sandbox. I have an apex class in it (Lets say A). I have to deploy another apex class (lets say B) manually since i need to update few IDs into it. Class B has to refer few functions which are present into class A (which is deployed through package). While trying to add class B, i get an error saying "Type Not Defined" for class A.

I also tried prefixing it with Namespace but that also did not work.

If i create a managed package with both the classes (class A and B), it works fine for me. But then i am not allowed to make the manual changes to the ID.

Any help will be highly appreciable.

Best Answer chosen by Admin (Salesforce Developers) 
OTDev2OTDev2

This is what i found out.

 

I created a managed package with a global class. In that global class, I have put three different methods with access modifiers as “global”, “public” and “webService”. Thereafter I deployed the managed package on one of the developer’s account.

 

On the developer’s account, now I created another class manually in which I tried to access all the three methods. Methods with “global” and “webService” access modifier got called but trying to access “public” method gave me an error saying “The method Is Not Visible”.

 

So if we want to package all the classes into Managed package, we will have to declare the access modifiers for each class as “global” or “webService”.

 

A good article to understand the difference between Global and Public could be found at http://www.salesforce.com/us/developer/docs/pages/Content/pages_js_remoting.htm

 

Thanks & Regards

Vivek Mohit

All Answers

hitzhitz

HI,

 

As per my understanding you are trying to use package calss (Class A) methods or variable into non packaged class (Class B). If right then you packaged class (Class A) must be globel calss.

OTDev2OTDev2

This is what i found out.

 

I created a managed package with a global class. In that global class, I have put three different methods with access modifiers as “global”, “public” and “webService”. Thereafter I deployed the managed package on one of the developer’s account.

 

On the developer’s account, now I created another class manually in which I tried to access all the three methods. Methods with “global” and “webService” access modifier got called but trying to access “public” method gave me an error saying “The method Is Not Visible”.

 

So if we want to package all the classes into Managed package, we will have to declare the access modifiers for each class as “global” or “webService”.

 

A good article to understand the difference between Global and Public could be found at http://www.salesforce.com/us/developer/docs/pages/Content/pages_js_remoting.htm

 

Thanks & Regards

Vivek Mohit

This was selected as the best answer