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
Madhan Raja MMadhan Raja M 

Can we access a class from one Manage package to another Manage Package

Greetings,

 

Can we access a class from one Manage package to another Manage Package? If yes, please let me know how it can be achieved?

 

Thanks in Advance.

 

Madhan Raja M

 

Best Answer chosen by Madhan Raja M
bob_buzzardbob_buzzard

You can't solve it - you have created a dependency on managed package a, therefore that has to be installed into any organisation that wants to install managed package b.  These are known as extension packages.

All Answers

bob_buzzardbob_buzzard

You can do this if the second managed package is an extension to the first and the class is global.  To achieve this you would have to install the first managed package into your second managed package developer org.

Madhan Raja MMadhan Raja M

Thanks for your reply Bob!

 

It would be really grateful, if you can give me a sample code to achieve it.

 

Madhan Raja M

 

bob_buzzardbob_buzzard

I'm afraid I don't have any sample code that I can share - our extension and base packages are company IP.

 

A great resource for this is : http://wiki.developerforce.com/page/Architecting_a_Commercial_Application

Madhan Raja MMadhan Raja M

Hi Bob,

 

Here is my scenario, I need to create two Managed Packages called Package-A and Package-B. In Package-A, there will be a method which should call the class in Package-B. I am able to build Package-B without any issue.

 

However, am not able to create Package-A without including ‘InvokeService’ class in the package.

 

Please refer the below snapshot for more information:

 

 

Thanks in advance!

 

Madhan Raja M

bob_buzzardbob_buzzard

When I've done this, building the package just makes the point that some of the components I'm relying on are part of an existing package.  

Madhan Raja MMadhan Raja M

Thanks for the quick response, Bob.

 

Can you please elaborate on the same. Because I am working on packaging for the first time.

 

Madhan Raja M

bob_buzzardbob_buzzard

I have a dev org with package B installed into it (not the package B dev org) and I then create my additional functionality and when I upload package A it tells me that there is a dependency on package B.

Madhan Raja MMadhan Raja M

Correct, Bob. I am facing the same issue. How to solve it?

 

Madhan Raja M

bob_buzzardbob_buzzard

You can't solve it - you have created a dependency on managed package a, therefore that has to be installed into any organisation that wants to install managed package b.  These are known as extension packages.

This was selected as the best answer