3

My intend to create a base package with core features that will be used by my other packages. This will allow users to select only the packages that contain the features that they want, rather than giving them one large package with functionality that they will never use.

To create extension package, i read from salesforce help doc and i only did following step:

Installed my 'base managed package' in another dev org where i want to create extension package. Could you please explain me that, what are the next steps. Let's say i have to give one new 'VF page' as an extra feature over my base package. Then how should i build extension package here.

Thanks in advance.

5

Step 1: Install the managed package (the "base" package) into a new developer edition.

Step 2: Give the new developer edition a new namespace, create the new managed package (the "extension" package), and upload that package.

Step 3: Done.

Some notes are worth pointing out here. The extension package will implicitly link itself not just to the base package, but also the version of the base package, on a per-upload basis. For example, if the base package is 1.25 and the extension package is 1.2, then the extension version 1.2 will be linked to base package 1.25, so you can't install 1.2 in an org with an older version (say, base version 1.24).

The linkage only occurs if you explicitly reference any element in the base package, such as a field, object, or class. Standard fields and objects do not count. The base package isn't ever allowed to reference the extension package explicitly, and so will need to use dynamic references and Apex Code. Keep this in mind when building your base package.

Be sure to use global interfaces and classes in the base package if the extension package needs to reference those items in the base package. You won't be able to easily remove these classes and methods later, so choose carefully. Once a version of the extension is linked to a version of the base package, you can't ask for a rollback of the base package to an earlier version than was linked, so also keep that in mind as well.

For all of the cautionary tales I present here, I'd like to mention that it is deceptively easy to create extension packages, even to the point where you could do so accidentally. For example, if you install a third-party managed package, and you accidentally reference a member of that package, it automatically gets linked as a dependency as soon as you upload that version. You can rollback the upload by contacting support, but not if you install it in any customer's org. At that point, the link is permanent.

I would strongly recommend avoid installing any managed package that you don't intend to link to, in order to avoid the accidental links. This also means you should never install the extension into the base package's host organization. Always use an ISV throw-away organization to test and demo how the two packages interact with each other, so that you can uninstall and rollback (or patch) if something goes wrong.

  • I have installed my base managed package into new dev org. and trying to create new extension package, but there is no any dependency component of base package, which i should add to my extension component. Could you please help me on, how should i add dependency of base package to extension package? – Harish Mache Mar 9 '15 at 9:19
  • The dependency occurs only when you reference the other app through a link, such as a reference to a class, object, or field. You can't specify a dependency independently. – sfdcfox Mar 9 '15 at 9:24
  • Thanks sfdcfox for your response. sorry, i am completely new to salesforce, could you please give me idea for how to reference the app through link. – Harish Mache Mar 9 '15 at 9:30
  • @HarishMache Any way you want. Call a method, query a field, do anything that results in a hard reference to the base package. – sfdcfox Mar 9 '15 at 9:52
  • @sfdcfox, quick idea if we can use this in normal dev orgs and not with ISV orgs? Thanks – Kaushik Ray Nov 10 '15 at 9:08
0

Now you need to create a new package and add your extension components. Salesforce automatically include the related components.

Upload the new package that contains the extension components

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.